Copying a tag value using its iterator with Exiv2::invalidByteOrder
uses the wrong byte order
#3199
Labels
Exiv2::invalidByteOrder
uses the wrong byte order
#3199
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 usinggexiv2_metadata_get_tag_raw()
which callsExiv2::ExifData::iterator.copy(..., Exiv2::invalidByteOrder)
on the tag value.The
copy()
implementation ends up callingus2Data()
withinvalidByteOrder
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.jpgCopy 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:
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).The text was updated successfully, but these errors were encountered: