简体   繁体   中英

Extract EXIF information from image

I want to read the EXIF information from an image using C#, and everything is actually in place, I have a class where I send in the Image and I can then start requesting EXIF tags.

But the problem is speed, currently my only option is using Image.FromFile() while loads the entire image into memory, which in this case is pretty pointless since I just need a teeny bit of information.

So my question is if there is a better way to read the EXIF, maybe just open a filestream and read out the segment and parse it myself, but that seems to me like reinventing the wheel. Or maybe it's just Image.FromFile() that is the wrong function to use in this case.

Please enlighten me :)

EDIT

I ended up reinventing the wheel, mostly because the information out there was quite horrid, and because I had a few spare hours to kill.

After deciphering the jpeg/exif/tiff structure I can now read and parse the exif information in almost zero time. I really only need a couple of the tags but I may extend this library as I go along.

Ah and btw, this page: http://gvsoft.homedns.org/exif/exif-explanation.html is quite good and gives you alot for free.

I don't know much about exif but, perhaps you can copy out the exif information and write it into a tiny temporary jepg. After that you can read the small jpeg as you described.

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