Created attachment 115991 [details] Sample files (The file names are self-explanatory) SUMMARY Rotation functionality does not seem to work properly. Use the attached images for testing. In Settings // Configure digiKam // Metadata // Rotation set "write normal flag orientation after rotate". Other settings as per attached screenshot. STEPS TO REPRODUCE Try to manually rotate left or right, autorotate, set orientation flag. OBSERVED RESULT The image either does not rotate at all or rotate somewhat unexpectedly. The orientation flag as per Item // Adjust Exif Orientation Tag remains as "rotated right", although exiv2 confirms that after rotation, the flags are "top, left". Rebuilding thumbnail (Tools // Maintenance) does not change this behaviour. On some images, the thumbnail orientation flag may become inconsistent with other orientation flags. EXPECTED RESULT The image visually rotates as per instruction, the thumbnail is rebuilt and orientation flag is set to normal in all metadata types (Exif, Thumbnail, TIFF, etc.). SOFTWARE VERSIONS digikam-6.0.0-beta2-20181030T031645-x86-64.appimage OTHER INFORMATION The inconsistency of orientation flag in metadata seems to have different impact on different actions (autorotate, rotate manually in Thumbnails view, in Preview View).
The prior version digikam-6.0.0-beta2-20181015T071907-x86-64.appimage seems to work as expected.
Gilles must create a new AppImage, this has a problem with write item information to the DB. Maik
Maik, AppImage have been updated today evening with your commit from this morning. Gilles
Milan, can you please test it with the latest AppImage? Your version of time 03:16:45 was affected by the error. New version is: digikam-6.0.0-beta2-20181030T175240-x86-64.appimage Maik
This one works again. However, I am still wondering if it is a problem that even after rotation (which sets the Orientation Flag to "Normal"), the flag for thumbnail is still reported as "rotated" (even after rebuilding the thumbnails): $ exiv2 -pa z2.jpg | grep -a rientat Exif.Image.Orientation Short 1 top, left Exif.Thumbnail.Orientation Short 1 right, top Xmp.tiff.Orientation XmpText 1 top, left It does not seem to cause problem in digiKam Preview view, in EOG, in Geeqie - all show the thumbnail properly. The Exif.Thumbnail.Orientation flag is removed when the image is edited in digiKam's editor and saved. Shouldn't it be either synced with the image orientation or removed also within Rotation actions in digiKam?
One app is confused with out of sync orientation flag - the default Gallery app in Samsung S7. It displays the embedded thumbnail as per Exif.Image.Orientation and ignores Exif.Thumbnail.Orientation. It is probably Samsung's bug, but anyway, wouldn't it be safer to have the image and embedded thumbnail orientation in sync?
I do not see a mistake here. Only very few cameras have Exif.Thumbnail.Orientation, yes Samsumg is one. If you only rotate the indicator, digiKam also updates Exif.Thumbnail.Orientation. If you rotate the image lossless, only the main image is rotated, the preview image is not. I do not know if LibJpeg can also rotate the embedded preview image lossless, I do not think so. This is of course different with the image editor, as it always generates new image data and also generates a new preview image. Maik
In your case, so it works with the Samsung Gallery app, I would only rotate the indicator. Maik
The thing is, the flag for thumbnail does not rotate - it stays as it was originally (from camera) and the thumbnail rotates physically. Try show the exif metadata in the right hand pane, filter for orientation flag and rotate the image. In other words, originally both flags might be "rotated right", but when I rotate the image, then the image flag gets set to 'normal', while the thumbnail flag remains 'rotated right'. In order to get the thumbnail displayed correctly (in Digikam), digiKam must actually physically rotate it, too. The trouble is, that the above behaviour unsyncs the flags and the thumbnail is not shown properly anymore (in Samsung Gallery app).
Git commit 866ccbc40a9796ccfda20f7026bd690bea65a99a by Maik Qualmann. Committed on 01/11/2018 at 19:30. Pushed by mqualmann into branch 'master'. fix write orientation flag to Exif.Thumbnail.Orientation FIXED-IN: 6.0.0 M +2 -1 NEWS M +5 -4 core/libs/jpegutils/jpegutils.cpp M +1 -3 core/libs/metadataengine/engine/metaengine_image.cpp https://commits.kde.org/digikam/866ccbc40a9796ccfda20f7026bd690bea65a99a
Thanks Maik, the latest digikam-6.0.0-beta3-20181102T200629-x86-64 works fine.
Thanks Milan for the feedback. Gilles Caulier