Is there any sample code to read thumbnail from Jpeg exif header?

守給你的承諾、 提交于 2019-12-12 11:08:50

问题


I am writing application using c++, in windows.

I want to get a thumbnail from jpeg, without decoding the whole image. How Can I read thumbnail from jpeg exif header? Can any one offer me a some sample code?

Many thanks!


回答1:


Unsurprisingly the library is called libexif has win32 port, and there is sample code for reading thubnail from file




回答2:


Don't bother. You can create tumbnails very fast from JPEGs. They are compressed using DCTs on 8x8 pixel blocks. So, get the DC component (i.e. 0,0) of each block and you have an 1/64th thumbnail without decoding. Further scaling should be fast since there are hardly any pixels left.



来源:https://stackoverflow.com/questions/1286662/is-there-any-sample-code-to-read-thumbnail-from-jpeg-exif-header

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!