[Development] Rotating JPEG images by default

Konstantin Ritt ritt.ks at gmail.com
Mon Apr 20 06:53:30 CEST 2015


And to be honest, I don't like the QImage::orientation() API addition w/o
providing setOrientation() and a respective code code in the image writer
to store orientation as metadata (when possible).
`QImage img(sourcePath); img = img.scaled(img.width() / 2, mg.height() /
2); img.save(destPath);` should not loose the metadata when the format has
not been changed (at least).

Regards,
Konstantin

2015-04-20 8:37 GMT+04:00 Konstantin Ritt <ritt.ks at gmail.com>:

> I failed to find an official announcing for the EXIF-based auto-rotation
> of QImage-s (correct me if I'm wrong), so it looks just like a behavioral
> regression to me, nothing more.
> IMO, we should revert the behavior to pre 5.4 and give the control over
> the image aspects to the user, not to an arbitrary image loader.
> I mean https://codereview.qt-project.org/#/c/110685/ and
> https://codereview.qt-project.org/#/c/101084/ could co-operate quite
> nicely
> to make the user think: "why my photo gets loaded rotated 90 degrees? ah,
> img.sourceOrientation() == QImage::Rotated90 -->
> img.transform(img.sourceOrientation())")
>
> P.S. Also not the sample image in QTBUG-37946
> <https://bugreports.qt.io/browse/QTBUG-37946> isn't auto-rotated in your
> web browser (well, at least in my web browser).
>
>
> Regards,
> Konstantin
>
> 2015-04-17 16:23 GMT+04:00 Rainer Keller <rainer.keller at theqtcompany.com>:
>
>> > I would like to mention one extra relevant detail. While this was
>> implemented
>> > for 5.4, it was not working in 5.4.0, and was only fixed for 5.4.1. So
>> sofar
>> > only 5.4.1 has had EXIF orientation automatically applied on JPEGs.
>> This also
>> > raises the question about what to do for 5.4.2?
>> I actually worked, theoretically. There was a bug with the endianess
>> when reading the data field. It worked when data was generated on little
>> endian machines but all photo cameras are big endian.
>> This means only photos taken on x86 machines would have been rotated.
>>
>> _______________________________________________
>> Development mailing list
>> Development at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/development
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20150420/9d366162/attachment.html>


More information about the Development mailing list