Bug 461205

Summary: HEIF images are not rotated properly
Product: [Applications] digikam Reporter: Axel Schwank <axel>
Component: Plugin-DImg-HEIFAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: metzpinguin
Priority: NOR    
Version First Reported In: 7.8.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In: 7.10.0
Sentry Crash Report:
Attachments: HEIC image (shows correct thumbnail, imported with digikam 7.1.0)
HEIC image (shows incorrect thumbnail, imported with digikam 7.8.0)
JPEG image (shows correct thumbnail, imported with digikam 7.8.0)

Description Axel Schwank 2022-10-30 13:32:52 UTC
Created attachment 153326 [details]
HEIC image (shows correct thumbnail, imported with digikam 7.1.0)

SUMMARY
HEIF images are not rotated properly according to their EXIF orientation unlike a (almost) comparable JPEG images.
I provide three images to compare: two HEIF images (HEVC codec), X dimension larger than Y dimension and orientation tag of 6 (which is commonly displayed as "Rotate 90 CM" or "top, right") and an JPEG image with the same properties regarding these aspects.
The JPEG image is displayed correctly (portrait) whereas the HEIF image is not (landscape). I guess the will be no difference in the HEIF images when they are imported, the reason why I provide two is that one of them (IMG_0770.heic) was imported with digikam 7.1.0 in my installation which generated a correctly oriented thumbnail (but shows an incorrect orientation of the preview image), whereas IMG_864.heic was imported with digikam 7.8.0 where both thumbnail and preview are wrong. So it seems there is a change in behaviour.
 Gwenview and the dolphin preview show everything fine.


STEPS TO REPRODUCE
1. Import HEIF image with orientation 6 (example provided)

OBSERVED RESULT
Wrong orientation (landscape)

EXPECTED RESULT
Correct orientation (portrait)

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: openSuSE Tuwbleweed 20221014
(available in About System)
KDE Plasma Version: 5.26.0
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.6

ADDITIONAL INFORMATION
Comment 1 Axel Schwank 2022-10-30 13:34:15 UTC
Created attachment 153327 [details]
HEIC image (shows incorrect thumbnail, imported with digikam 7.8.0)
Comment 2 Axel Schwank 2022-10-30 13:35:27 UTC
Created attachment 153328 [details]
JPEG image (shows correct thumbnail, imported with digikam 7.8.0)
Comment 3 Maik Qualmann 2022-10-30 13:46:07 UTC
Error has already been reported.  Since newer digiKam versions use the libheif installed in the system, the problem will not be fixed until openSUSE switches to libheif-1.13.

Maik
Comment 4 Maik Qualmann 2023-01-08 07:48:09 UTC
On openSuSE Tumbleweed, libheif is now at version 1.14. The problem of incorrectly rotated HEIF images is now resolved.

Maik