Menu

#5 RATIONAL types not handled properly

open
nobody
None
5
2009-05-10
2009-05-10
No

The GetImageFileDirectoryEntries subroutine assumes that all RATIONAL type values have a value count of 1. While this is true for all but some obscure camera tags, it is not universally true. In fact, many of the tags in the GPS IFD have a value count of three.

Here is an approach to a fix that delimits the values with commas:

.Value = ""
For j = 0 To BytesPerValue * .Tag_Values_Count - 1 Step BytesPerValue
.Value = .Value & _
JPGFileBytes(Offset_to_TIFF + .Offset_To_Value + 0 + j) * 256& * 256& * 256& + _
JPGFileBytes(Offset_to_TIFF + .Offset_To_Value + 1 + j) * 256& * 256& + _
JPGFileBytes(Offset_to_TIFF + .Offset_To_Value + 2 + j) * 256& + _
JPGFileBytes(Offset_to_TIFF + .Offset_To_Value + 3 + j) & _
"/" & _
JPGFileBytes(Offset_to_TIFF + .Offset_To_Value + 4 + j) * 256& * 256& * 256& + _
JPGFileBytes(Offset_to_TIFF + .Offset_To_Value + 5 + j) * 256& * 256& + _
JPGFileBytes(Offset_to_TIFF + .Offset_To_Value + 6 + j) * 256& + _
JPGFileBytes(Offset_to_TIFF + .Offset_To_Value + 7 + j) & ","
Next
.Value = Left(.Value, Len(.Value) - 1) 'clip off the trailing comma

Discussion


Log in to post a comment.