Empty object 15 in pdf (pdf.c)

Post any defects you find in the released or beta versions of the ImageMagick software here. The ImageMagick maintainers carefully monitor this list and will work diligently to repair any reported problems. When posting a bug report, please specify both the ImageMagick version and operating system you are using.

Empty object 15 in pdf (pdf.c)

Postby baskote » 2007-06-11T06:14:59+00:00

Hi,

converting a jpg to pdf is creating an empty pdf object, which creates an error on acrobat.
The problem happens in pdf.c (ImageMagick 6.3.4), there will be checked for (image->matte != MagickFalse) and only then content will be written. So i patched it and moved the output of the object start and end inside of the if, so it will be printed only if the content is printed too.

-------
14 0 obj
13575
endobj
15 0 obj
endobj
16 0 obj
13575
-------

Here is the patch for ImageMagick 6.3.4

Code: Select all
--- pdf.c.org   2007-06-11 14:31:35.000000000 +0200
+++ pdf.c       2007-06-11 14:29:33.000000000 +0200
@@ -2047,11 +2047,11 @@
     /*
       Write softmask object.
     */
-    xref[object++]=TellBlob(image);
-    (void) FormatMagickString(buffer,MaxTextExtent,"%lu 0 obj\n",object);
-    (void) WriteBlobString(image,buffer);
     if (image->matte != MagickFalse)
       {
+        xref[object++]=TellBlob(image);
+        (void) FormatMagickString(buffer,MaxTextExtent,"%lu 0 obj\n",object);
+        (void) WriteBlobString(image,buffer);
         (void) WriteBlobString(image,"<<\n");
         (void) WriteBlobString(image,"/Type /XObject\n");
         (void) WriteBlobString(image,"/Subtype /Image\n");
@@ -2178,8 +2178,9 @@
         }
         offset=TellBlob(image)-offset;
         (void) WriteBlobString(image,"\nendstream\n");
+        (void) WriteBlobString(image,"endobj\n");
       }
-    (void) WriteBlobString(image,"endobj\n");
+
     /*
       Write Length object.
     */


Can you please give us feedback if this will be applied ?

Markus
baskote
 
Posts: 14
Joined: 2007-01-03T07:32:08+00:00

Re: Empty object 15 in pdf (pdf.c)

Postby magick » 2007-06-11T07:59:26+00:00

We applied your patch to ImageMagick 6.3.4-9 Beta available sometime tommorrow. Thanks.
User avatar
magick
Site Admin
 
Posts: 6518
Joined: 2003-05-31T11:32:55+00:00

Re: Empty object 15 in pdf (pdf.c)

Postby spirofantasio » 2007-06-13T16:22:49+00:00

I have the same problem in converting JPGs into a single PDF file.

I've just downloaded ImageMagick 6.3.4-9 and it does not appear to have solved the problem.
spirofantasio
 
Posts: 2
Joined: 2005-06-15T07:14:57+00:00

Re: Empty object 15 in pdf (pdf.c)

Postby baskote » 2007-06-14T06:01:26+00:00

i checked the version 6.3.4-9 and the fix is included and worked with our jpg images. Are you able to post the examples somewhere and provide more informations about the error you detected and how you have seen the error ?
baskote
 
Posts: 14
Joined: 2007-01-03T07:32:08+00:00

Re: Empty object 15 in pdf (pdf.c)

Postby oddball508 » 2009-01-22T18:51:03+00:00

I am having the same problem as this. Does anyone have an answer? I can provide a sample file.
oddball508
 
Posts: 29
Joined: 2005-05-14T17:20:01+00:00


Return to Bugs

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests