[digiKam-users] Lossless rotate & auto-rotate

classic Classic list List threaded Threaded
2 messages Options
SDX
Reply | Threaded
Open this post in threaded view
|

[digiKam-users] Lossless rotate & auto-rotate

SDX
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)
2 - is "Auto Rotate/Flip Using Exif information" lossless?

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.



--
Sent from: http://digikam.1695700.n4.nabble.com/digikam-users-f1735189.html
Reply | Threaded
Open this post in threaded view
|

Re: Lossless rotate & auto-rotate

Gilles Caulier-4
Hi,

Le jeu. 25 févr. 2021 à 08:28, SDX <[hidden email]> 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