By default, the photos taken with these cameras can give away sensitive information, and many users are unaware that it’s happening.More people than ever have a camera that’s usually within arm’s reach.Read all EXIF Package Tags and values.įoreach (TiffTag tag in mass adoption of smartphones - essentially portable, sensor-rich, location-aware, always-networked computers - has given us two major consequences whose effects on privacy and security aren’t yet fully understood: Extract all EXIF Metadata from the image Similarly, get the IFD & GPS packages to displays its keys and values.Iterate the EXIF package and get desired name-value pairs.Get the EXIF package from the ExifPackage property of the root package.Get the root package by calling the method GetRootPackage().Load the image with Metadata constructor.You can extract all the EXIF properties of any image, you may do it in an almost similar fashion as above: Display EXIF GPS Information like Latitude, Longitude, etc.Ĭonsole.WriteLine() Ĭonsole.WriteLine() Ĭonsole.WriteLine() Display EXIF IFD Package Properties like Serial Number and Camera Owner.Ĭonsole.WriteLine() Ĭonsole.WriteLine() Ĭonsole.WriteLine() From these packages, you can extract much more information than mentioned below:īelow mentioned code can be added in your above method to display EXIF data along with IFD & GPS information. Now for IFD and GPS package information, you just have to access the respective properties of EXIF package i.e. Reading EXIF IFD & GPS Information of Image #ĮXIF data also include the Exif IFD (Image File Directory) and GPS (Global Positioning System) Information. The above code will display the following available EXIF information of the provided JPG image. If (root != null & root.ExifPackage != null)Ĭonsole.WriteLine() Ĭonsole.WriteLine() Ĭonsole.WriteLine() Ĭonsole.WriteLine() Ĭonsole.WriteLine() IExif root = metadata.GetRootPackage() as IExif Using (Metadata metadata = new Metadata("statue-of-liberty.jpg")) Extract EXIF Data Package Information from image in C# Once you have the EXIF package, you can now access the EXIF properties of the image like Make, Model, Width, Length, DateTime, Copyright, Software, etc as shown below in C# code example.From the root package, get its ExifPackage from its ExifPackage property.Get its root package by calling GetRootPackage() method.Load the image source file containing EXIF data information using the Metadata class constructor.Here we will use a JPG file as an example image, however, we can use any file whether its a PNG, WebP, BMP, GIF, TIFF, or any other from the supported file formats mentioned at the end of this article.
Starting with the extraction of EXIF data from this picture, 93m tall Statue of Liberty. You can easily read the EXIF data properties by following the mentioned steps. In this article, we will use this API, so please make sure to download its binaries or install the API from NuGet. It has the ability to not only extract metadata from images but also it can add, edit, update, and remove metadata from the images and documents with various options. It has a long list of features for a wide variety of supported file formats. We will cover the following ways to manipulate with EXIF data in C#: If you haven’t visited the last post, but you want to extract, update, add or remove EXIF data of your images programmatically in C#, then this article will guide you through this. Here, today we will look into achieving the same but in C#. In the previous post, we discussed how to deal with EXIF data of images in Java.