Menu

#3 Big Endian TIF Lat/Lon reference in exif

open
None
5
2015-05-26
2015-05-26
No

A programming consultant of ours provided a fix for this bug. Please see below:

Under TiffDirectory.cpp file:

void TiffDirectory::writeByteArray(TiffDirEntry& dirEntry, int8* dp)
{

   if (dirEntry.count > 4)
{
    // Size of value is too large to fit in the 4 byte
    // lenght of the entry's offset. So, write it out
    // somewhere else, and store the offset to the value
    // in TiffDirEntry's offset element.

    dirEntry.offset = tiffio->seek( dataOffset, SEEK_SET ) ;

    tiffio->write(dp, dirEntry.count);
    dataOffset = tiffio->seek(0, SEEK_END);        
}

else
{
    // Copy directly into the offset element of
    // the TiffDirEntry structure since it will
    // fit.


          memcpy(&dirEntry.offset, dp, dirEntry.count);
          tiffio->swabLong(&dirEntry.offset); // added to handle lat/lon ref. exif data for Big Endian photos

}

}

Discussion


Log in to post a comment.

MongoDB Logo MongoDB