开发者

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 开发者_JAVA技巧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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜