Fix #923: Wrong orientation in HEIC using EXIF
authorColin Clark <colin.clark@cclark.uk>
Sun, 12 Sep 2021 14:41:32 +0000 (15:41 +0100)
committerColin Clark <colin.clark@cclark.uk>
Sun, 12 Sep 2021 14:41:32 +0000 (15:41 +0100)
commitac15f03b0b11ea0b5261818ab210a42f75033359
tree2d147e76ed432c95faabee6f0df9fd4e05782586
parent17e1716b05f5ccb3bf8d5715e748e69acd52716d
Fix #923: Wrong orientation in HEIC using EXIF

https://github.com/BestImageViewer/geeqie/issues/923

This is an excerpt from ISO/IEC 23008-12:2017(E):

---------
Metadata specified in Annex A or according to the item type and MIME
type values is descriptive and does not normatively affect the
presentation.
In particular, an image item can be rotated by 90°, 180°, or 270° using
the 'irot' transformative item property.
Rotation metadata, e.g. according to Annex A, is ignored in the
displaying process.

8.2 Metadata for image items
------------

Therefore libheif is rotating the image in accordance with the irot
property - and then Geeqie rotates it again using the Exif value.

If the libheif decoding option "ignore_transformations" is used, the
result is different on two systems I use - one one system the option is
ignored, and on the other system the option is used, but then no Exif
data is displayed for the file.
As the compiled code is the same in both cases, there must be an
influence from other system library files.

The implemented solution ignores the Exif rotation parameter and
inhibits writing manually applied rotation metadata for all files
processed by libheif.
src/filedata.c
src/image-load.c
src/image.c
src/layout_image.c
src/pan-view/pan-view.c
src/thumb.c
src/thumb_standard.c
src/typedefs.h