Empty indirect objects in PDF generated by convert

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
michelonoff
Posts: 1
Joined: 2013-01-23T10:49:32-07:00
Authentication code: 6789

Empty indirect objects in PDF generated by convert

Post by michelonoff »

Sometimes convert produces a PDF that contains a totally empty PDF indirect object like

13 0 obj
endobj

It happens, for example, on converting a JPG image to PDF. (Here the PDF simply acts as a wrapper around the JPG bytes. Rendering the PDF shows the image on a single paged document.)

Most PDF readers accept such documents, yet this is not valid syntax. As per PDF spec:
"The definition of an indirect object in a PDF file consists of its object number and generation number, followed by the value of the object bracketed between the keywords obj and endobj"

The above syntax does not enclose anything that resembles a PDF object. I'm not even sure if the indirect object is ever referenced inside the PDF (e.g., by means of a 13 0 R construct). Since the object seems useless anyway, this is a second good reason not to produce it.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Empty indirect objects in PDF generated by convert

Post by magick »

We can reproduce the problem you posted and have a patch in ImageMagick 6.8.2-0 Beta available by sometime tomorrow. Thanks.
Post Reply