Hi Jose, please see comments below.
On Sun, Dec 6, 2009 at 5:10 AM, Jose
I rotate jpeg photos to portrait by reading the file and saving it like this:
boost::gil::jpeg_write_view(file, boost::gil::rotated90cw_view(boost::gil::view(img)));
results:
original size: 4106172 image/jpeg 3264 2448 rotated size: 5594681 image/jpeg 2448 3264
The rotation should be lossless (as the image is a multiple of the jpeg MCU) but the size has increased significantly and the exif tags disappeared.
I think libjpeg has a way of applying lossless transformations while reading it. Is that correct, or am I mistaken here? How do you preserve the exif tags? Does a user has to read them separately and cache them? In the new io extension there is the image_write_info structure which would allow a user to pass additional information when writing images. I would be more then willing to add functionality to the new gil::io. Can you provide a small libjpeg example? I'll also have a look at jpegtran.
My questions:
Has it been tested that the rotation is lossless ? What can I do make sure the exif tags are preserved ?
Good questions ;-) I'll investigate.
thanks jose
Christian PS: I see there is still one email from you I need to answer. Will do that later on.