[ome-users] BigTIFF OME-TIFFs do not meet the BigTIFF standard

Matthias Baldauf matthias.baldauf at umit.at
Wed Nov 28 22:46:10 GMT 2012


Hi Melissa, 

thank you for your response!
I have used your code snippet but I get the same result with it:
Libtiff 4.0.2 fails to open BigTIFF OME-TIFFs with big endian byte order. 

According to the BigTIFF specification, the first eight bytes are grouped in four groups with two bytes each (datatype = word). 
For me, it seems that the first eight bytes of BigTIFF OME-TIFFs only consist of three groups. Two two-byte groups and one four-byte group. 
Therefore, BigTIFF OME-TIFFs with little endian byte order are valid because the position of the number 8 is correct. 
But for BigTIFF OME-TIFFs with big endian byte order, the number 8 should be two positions towards the left side. 

In the Java class "TiffSaver", I found the following line in the writeHeader() method: 
    out.writeInt(8); 
As this line will always write four bytes at once, I think it should be replaced by: 
    if (bigTiff) { 
        out.writeShort(8); 
        out.writeShort(0); 
    }else out.writeInt(8); 

After changing these lines, TiffSaver creates valid BigTIFFs for both, big & little endian byte order. 
I use the following code snippet to read the first eight bytes: 

// -- begin -- 
RandomAccessFile ra = new RandomAccessFile(new File(bigometiff), "r"); 
for(int i=0; i<8; i++) 
    System.out.println(ra.read()); 
ra.close(); 
// -- end -- 

I hope I can help you with this information.

Kind regards, 
Matthias




More information about the ome-users mailing list