[digiKam-users] Lossless rotate & auto-rotate

Gilles Caulier caulier.gilles at gmail.com
Thu Feb 25 08:35:39 GMT 2021


Hi,

Le jeu. 25 févr. 2021 à 08:28, SDX <sdx at inbox.lv> a écrit :
>
> Hello, I have read through lots of documentation and could not find a
> definitive answer IF and when DigiKam 7.2 uses lossless Jpeg rotation?
> If I rotate a JPG file, it all the time changes file size, so it probably is
> NOT lossless?
> Also DigiKam is not on the list here: http://jpegclub.org/losslessapps.html
>
> 1 - is normal "Rotate Left/Right" lossless for JPG files? (it seems to be
> no)

yes, it is. We use internally transup algorithm from libjpeg:

https://invent.kde.org/graphics/digikam/-/blob/master/core/libs/jpegutils/libjpeg/62/transupp.h

> 2 - is "Auto Rotate/Flip Using Exif information" lossless?

yes, it just a tag fixed in metadata. image is not modified.

>
> Because of the known issue that Windows Photo Gallery does not understand
> rotation tags, I would like to fix all photos using "Auto Rotate/Flip Using
> Exif information", but if DigiKam can not do it losslessly, then there
> should be a confirmation dialog to stop people from messing up their photos.
>
>
> Note, I also noticed that after DigiKam writes metadata to JPEG files from
> Panasonic camera, the file becomes a few KB smaller. This is very strange as
> DigiKam presumable wrote more metadata to it than Windows Photo Gallery and
> yet the file becomes smaller... Scary stuff.

All operations in metadata are operated by Exiv2 and tounch only JPEG
section hosting metadata. Image data are located in separated section
and are not modified.

Best

Gilles Caulier


More information about the Digikam-users mailing list