2022.11.12 21:50 "[Tiff] Fatal error with JPEG compression", by Miguel Medalha

2022.11.12 22:52 "Re: [Tiff] Fatal error with JPEG compression", by Toby Thain

I tried all kinds of tiffs from several origins and the result is the same, I cannot use JPEG compression. Does anyone have any clues on why this is happening?

For me, setting rows per strip (-r) to a multiple of 8 or 16 respectively fixes this. Did you try that?

[toby@macpro31 scans]$ tiffcp -c jpeg 286.tiff 286j.tif
JPEGSetupEncode: RowsPerStrip must be multiple of 16 for JPEG.
286j.tif: Error, can't write strip 0.
[toby@macpro31 scans]$ tiffcp -c jpeg -r 128 286.tiff 286j.tif
[toby@macpro31 scans]$ tiffinfo 286j.tif
TIFF Directory at offset 0x1398832 (155830)
   Subfile Type: (0 = 0x0)
   Image Width: 2550 Image Length: 3300
   Resolution: 300, 300 pixels/inch
   Bits/Sample: 8
   Compression Scheme: JPEG
   Photometric Interpretation: YCbCr
   Orientation: row 0 top, col 0 lhs
   Samples/Pixel: 3
   Rows/Strip: 128
   Planar Configuration: single image plane
   Reference Black/White:
      0:     0   255
      1:   128   255
      2:   128   255
   JPEG Tables: (142 bytes)

--Toby