Closed luspi closed 4 months ago
There's no bug here: the "1" you see is the count of elements, the stored value is correct: "right, top" is 6. You can confirm this by exiv2 -Pkycvt
(-pa
is equivalent to -Pkyct
).
Anyway, orientation w/ HEIFs is somewhat of a tricky beast - the HEIF irot
/imir
properties (see output of exiv2 -pS
if those exist, although actual value is not parsed/printed by exiv2) take precedence over Exif tags, and they can be actually out of sync. In fact, HEIF readers are instructed to ignore the Exif orientation by the HEIF spec. When converting to JPEG and similar, some apps might actually do the orientation according to HEIF irot
/imir
, and then explicitly set Exif orientation to 1 (no further transformation, i.e. "top, left").
Ah, thanks, that makes sense :+1:
Describe the bug
I have a HEIF image that has an orientation value of
1
stored in it. With theexiv2
command line tool that value is correctly read as1
. However, when using the C++ API to read that value I get a value of6
back. Converting that image to a JPEG makes the C++ API to also return the correct value of1
.To Reproduce
Steps to reproduce the behavior:
exiv2 -p a testimage.heif
and obtain:Exif.Image.Orientation Short 1 right, top
./exiv2test testimage.heif
, and obtain:Exif.Image.Orientation = 6
./exiv2test testimage.jpg
, and obtain:Exif.Image.Orientation = 1
Expected behavior
The test code should return the correct value of
1
for both the HEIF and JPEG file.Desktop (please complete the following information):
-O3 -DNDEBUG
Additional context
The example test code consists of these two files:
CMakeLists.txt:
main.cpp: