tiff2pdf produces corrupted files if TIFF was written by GIMP
I have attached sample_files.zip. Inside this, working.tif
was created by ImageMagick, and tiff2pdf handles this fine and produces a working PDF.
However if I open that TIFF in GIMP and save it again (broken.tif
), the PDF produced by tiff2pdf is silently corrupted.
The PDF is generated normally with no errors or warnings, and some PDF viewers like Evince and Poppler can view it without problems, however Ghostscript and Acrobat are unable to open the file. Ghostscript complains about the wrong number of colour channels and then renders the page as three duplicate images side by side instead of just one, while Acrobat refuses to open the PDF at all complaining there is "not enough data".
I presume the bug lies in libtiff (as opposed to GIMP) however I am not 100% sure so I am reporting the bug here.
The sample files are attached and the .zip includes a text file with the tiff2pdf command I ran to produce the broken PDF, along with Ghostscript commands to test the resulting PDFs to see if they work or not.
This was tested with libtiff 4.1.0 under Arch Linux.