Description
Describe the bug
I'm trying to access Exif.Canon.AFInfo
, which is an array of uint16 values, via rexiv2 which uses gexiv2. There is no direct API access to the array of values so I'm using gexiv2_metadata_get_tag_raw()
which calls Exiv2::ExifData::iterator.copy(..., Exiv2::invalidByteOrder)
on the tag value.
The copy()
implementation ends up calling us2Data()
with invalidByteOrder
which is not handled correctly so it always returns big-endian data, despite the fact that I am reading a little-endian file on a little-endian host.
To Reproduce
Steps to reproduce the behaviour:
-
Read the
Exif.Canon.AFInfo
tag from these sample files: BE.txt BE.jpg LE.txt LE.jpg -
Copy the bytes from the iterator using
Exiv2::invalidByteOrder
-
Observe that the values are always in big-endian format
Expected behaviour
The API should disallow this type of access or the tag data should be returned in the original byte order.
Desktop:
- OS and version: Ubuntu 20.04
- Exiv2 version and source: 0.27.2-8ubuntu2.7
Additional context
There appears to be no API to get the byte order of the Exif data? I'm using Exif.MakerNote.ByteOrder
which happens to be a copy of the byte order (which is confusing because the Canon MakerNote footer does contain a byte order too).