简体   繁体   中英

C#.Net Fails to read some EXIF data from JPG Image

I have written simple module in C#.Net which reads image property (ie EXIF Data) and to do the same i have used below code:

Image ImgObject = new Bitmap("jpg image file path");

PropertyItem[] ImgObject = theImage.PropertyItems;

Collection of JPG images are captured from different Android devices (and explicitly added User Comments tag of EXIF data) - now C#.Net fails to read "User Comments" property. I have tried/checked using some other web based solution which reads "User Comments" field every time.

Any pointer on this would be great help. Thank You.

Exif metadata is very flexible, and sometimes is even used for stegonography. For getting user comments seem you have to work with bytes directly, reading everything before byte, indicating start of image, and then parsing it manually.

For reading metadata from image files such as JPEG, try my MetadataExtractor library. It supports many image and video formats, and many types of embedded data such as Exif, IPTC, XMP and so forth.

The API is very simple. You can access a file's metadata with a single line of code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM