如何从jpeg图像读取嵌入缩略图? [英] How to read embed thumbnail from jpeg images?

查看:146
本文介绍了如何从jpeg图像读取嵌入缩略图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在c ++中写缩略图查看器。

I am writing a thumbnail viewer in c++.

我首先使用EXIF信息来检索图像的缩略图,但是EXIF中的缩略图不好,黑带。

I first make use of EXIF information to retrive an image's thumbnail, but the thumbnail in the EXIF is bad, with black bands. So I want to get the jpeg's embedded thumbnail, how can I do this?

另一个问题:
会使jpeg嵌入的缩略图等于EXIF缩略图吗?

Another question: does jpeg's embeded thumbnail equal to EXIF thumbnial?

推荐答案

如果EXIF缩略图不好,您可以从JPEG自己生成自己,而不需要完全解码JPEG。

If the EXIF thumbnail is bad, you can generate your own from the JPEG itself, without needing to completely decode the JPEG.

查找 EPEG 的源代码。它是SourceForge上的启蒙项目的一部分,一年前是旧EFL的一部分。你仍然可以从一些旧的SVN提交或从一个可能浮动的源文件包中挖掘。

Look for the source code for EPEG. It's part of the Enlightenment project on SourceForge, and was part of the old EFL a year ago. You can still dig it up from some old SVN commits or from a source tarball that might be floating around.

基本上,EPEG的作用是收集DCT系数图像,并对它们执行重新缩放操作。 DCT系数通常用作8×8像素块的基本系数。您可以将其视为一个像素。因此,你有一个(计算自由)缩略图正好是原始图像大小的1/8。重新调整大小,将任何图片数据调整为所需的尺寸。

Basically, what EPEG does, is it collects the DCT coefficients from the image, and performs a rescaling operation on them. The DCT coefficient is normally used as the base coefficient for an 8x8 block of pixels. You can treat it as one pixel. As a result, you have a (computationally free) thumbnail exactly 1/8th the size of the original image. Rescale it as you would any image data to the desired dimensions.

这篇关于如何从jpeg图像读取嵌入缩略图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆