imagemagick having trouble converting multi-layer tif

I had some tiffs that I could open up in GIMP and save a layer at a time into a new jpeg. I really didn’t care for that method because I had a lot of pages and I would rather convert them to something like PDF anyway.

I tried converting the multi-layer TIFF to pdf using imagemagick:

# convert CONSUMABLEINVENTORY.tif Consumable.pdf

But it outputted:

Fax3Decode1D: Warning, CONSUMABLEINVENTORY.tif: Premature EOF at line 27 of strip 24 (x 0).
Fax3Decode1D: Warning, CONSUMABLEINVENTORY.tif: Premature EOL at line 27 of strip 24 (got 0, expected 2338).
Fax3Decode1D: Warning, CONSUMABLEINVENTORY.tif: Premature EOL at line 27 of strip 25 (got 0, expected 2338).

Weird. The resultant PDF had mostly blacked-out pages.

After some research I realized tiifcp could handle it. (a part of the tiff package. eg: emerge -av tiff on Gentoo )

# tiffcp -i CONSUMABLEINVENTORY.tif CONSUMABLEINVENTORY-new.tif
# convert CONSUMABLEINVENTORY-new.tif Consumable.pdf

And awesomeness ensued. Or at least a clean PDF file.

Cross Ref:
http://www.asmail.be/msg0055459042.html
tiffcp can clean tiffs with weird null EOL’s.
http://www.imagemagick.org/discourse-server/viewtopic.php?f=10&t=9907
Moderator on imagemagick explaining that libtiff might be encountering errors that other programs cope with (by ignoring errors).

Leave a Reply

Your email address will not be published. Required fields are marked *

To see if you are a human *