AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2000.02.02 17:50 "Microsoft Imaging and Jpeg in TIFF", by Randall Myers
[...]
2000.02.03 11:10 "Re: Microsoft Imaging and Jpeg in TIFF", by Andy
2000.02.04 09:32 "Re: Microsoft Imaging and Jpeg in TIFF", by Andy
[...]

2000.02.04 09:32 "Re: Microsoft Imaging and Jpeg in TIFF", by Andy

Hello,

So I guess my question is: What should Ri be?

Given unsigned image width, rows per strip, and samples per pixel (1 or 3), and unknown unsigned variable Ri (JPEGRestartInterval):

if(width%8 != 0 ) {
    Ri=(width+(8-(width%8)))*rowsperstrip/64;
} else {
    Ri=width*rowsperstrip/64;
}
if(samplesperpixel==3){
    if(Ri & 0x01) { Ri++; }
    Ri=Ri/2;
}

This handles so far the images I am testing. So, if you come across some TIFF/J that it does not handle, then that is another case, and please say so.

Andy