possible bug in reading pdf file

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

possible bug in reading pdf file

Post by fmw42 »

IM 6.5.9-10 Q16 Mac OSX Tiger

I was trying to read a pdf file provided by another user: http://www.martes.de/test.pdf

when I do

identify -verbose test.pdf
Unknown device: bmpsep8
Unrecoverable error: undefined in .uninstallpagedevice
Operand stack:
defaultdevice
identify: Postscript delegate failed `test.pdf': No such file or directory @ error/pdf.c/ReadPDFImage/638.


I have looked at this page:

http://www.gnu.org/software/ghostscript/devices.html

...
bmpsep8 Separated 8-bit CMYK .BMP file format, primarily for testing
...

and it says to do

gs -h

to get a list of devices and bmpsep8 is listed on my system.


Is this a problem with IM or with GS? Using GS 8.61

Other PDFs I can read and process with no problem. I also get the same problem reading eps files as well. Is this associated with cmyk bmp files embedded in the pdf or eps?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: possible bug in reading pdf file

Post by magick »

ImageMagick uses the bmpsep8 device for PDF's with colors in the CMYK or ICCBased colorspaces. If your version of Ghostscript does not support this device or if there is a bug in Ghostscript you will get an exception thrown. In the mean-time, for a workaround, add -colorspace RGB *before* the PDF image file name on the convert command line.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug in reading pdf file

Post by fmw42 »

magick wrote:ImageMagick uses the bmpsep8 device for PDF's with colors in the CMYK or ICCBased colorspaces. If your version of Ghostscript does not support this device or if there is a bug in Ghostscript you will get an exception thrown. In the mean-time, for a workaround, add -colorspace RGB *before* the PDF image file name on the convert command line.

My GS reports that it does have bmpsep8 device. But I should have tried adding -colorspace RGB as I know that is needed when reading CMYK pdf. But when I do that, I get this

convert -colorspace RGB test.pdf test.tiff
**** Warning: File has an invalid xref entry: 2. Rebuilding xref table.

**** This file had errors that were repaired or ignored.
**** The file was produced by:
**** >>>> itext-paulo-155 (itextpdf.sf.net-lowagie.com) <<<<
**** Please notify the author of the software that produced this
**** file that it does not conform to Adobe's published PDF
**** specification.


So I assume the input pdf is not valid and have reported that back to the original topic. Nevertheless, it did produce a valid looking result!

Thanks for the help.
Post Reply