使用libjpeg解码期间的无损JPEG旋转 [英] Lossless JPEG rotation during decoding with libjpeg

查看:450
本文介绍了使用libjpeg解码期间的无损JPEG旋转的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的C ++应用,它可以使用libjpeg解码JPEG-但是,其中有些图像它的过程横盘整理出来!这些输入图像的方向由照相机烘焙到EXIF数据中,但是似乎在解压缩期间,libjpeg并未像许多JPEG查看器那样考虑方向标记.

I've got a simple C++ app that decodes JPEGs with libjpeg - however, some of the images it processes come out sideways! These input images have orientations baked in to the EXIF data by the camera, but it seems that during decompression, libjpeg isn't taking the orientation flag into account as many JPEG viewers do.

是否有办法让libjpeg在解压缩期间遵守JPEG的方向,还是我必须解析出该方向标签并手动旋转图像?

Is there a way to get libjpeg to respect the orientation of the JPEG during decompression, or will I have to parse out this orientation tag and manually rotate the image?

推荐答案

libjpeg中的transupp.h标头定义了无损旋转的API. jpegtran.c还包括作为示例的可执行文件的源代码.

the transupp.h header in libjpeg defines an API for lossless rotation. Included is also, jpegtran.c, source code for an executable that serves as an example.

这篇关于使用libjpeg解码期间的无损JPEG旋转的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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