Bug #586

ValueType<T> constructor makes assumptions of the endianness of the machine

Added by Andreas Huggel 459 days ago. Updated 451 days ago.

Status:Closed Start:
Priority:Normal Due date:
Assigned to:- % Done:

90%

Category:metadata
Target version:0.18

Description

If I use the following code on Intel (little endian) machines:

exifData["Exif.Image.XResolution"] = Exiv2::ShortValue(37);

I get an expected resolution of 37 in the final image. However on
PowerPC (big endian) the bytes are swapped and the resolution value is
a lot bigger.

Reported by Dimitri in http://uk.groups.yahoo.com/group/exiv2/message/1449

Additional information:

The idea is that Exiv2 doesn't need to know the endianness of the machine in the first place - only that used in the TIFF data. This case violates this principle and makes an assumption for the endianness of the machine.

History

Updated by Dimitri Schoolwerth 458 days ago

Fixed by revision 1695, the above code now gives the same result on both little and big endian machines. There's no need anymore to always pass the native endianness as a parameter. Thanks!

Updated by Andreas Huggel 458 days ago

r1695

This bug remains open pending the removal of the obsolete byteOrder argument after 0.18 is released.

Updated by Andreas Huggel 452 days ago

  • Target version set to 0.18

Updated by Andreas Huggel 452 days ago

  • Status changed from New to Resolved

Updated by Andreas Huggel 452 days ago

  • % Done changed from 0 to 100

Updated by Andreas Huggel 452 days ago

  • % Done changed from 100 to 90

Updated by Andreas Huggel 451 days ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF