Bug 807858 - regression: fix for rotated PDF files breaks PS file convert
regression: fix for rotated PDF files breaks PS file convert
Status: CLOSED DUPLICATE of bug 804546
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: ImageMagick (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Benjamin Tissoires
Desktop QE
Depends On:
  Show dependency treegraph
Reported: 2012-03-28 19:38 EDT by Buck Huppmann
Modified: 2013-04-02 13:17 EDT (History)
4 users (show)

See Also:
Fixed In Version: ImageMagick-
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-04-02 13:17:59 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
slapdash patch that might fix problem (1.64 KB, patch)
2012-03-28 19:38 EDT, Buck Huppmann
no flags Details | Diff
revised (1.64 KB, patch)
2012-03-29 15:02 EDT, Buck Huppmann
no flags Details | Diff

  None (edit)
Description Buck Huppmann 2012-03-28 19:38:50 EDT
Created attachment 573488 [details]
slapdash patch that might fix problem

Description of problem:
The fix referenced in http://rhn.redhat.com/errata/RHSA-2012-0301.html
for the private bz #694922 breaks convert, when converting from PS
input files.

Version-Release number of selected component (if applicable):

How reproducible:
convert file.ps file.whatever

Steps to Reproduce:
Actual results:
[ghostscript library] -q -dBATCH -dSAFER -dMaxBitmap=500000000 -dNOPAUSE -dAlignToPixels=0 -dEPSCrop "-sDEVICE=pnmraw" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r612x792" 72x72 "-sOutputFile=" "-f/tmp/magick-XXOcprc6" "-f/tmp/magick-XXeCsmoL"
Error: /undefinedfilename in (72x72)
convert: no decode delegate for this image format `file.ps'.
convert: Postscript delegate failed `file.ps'.
convert: missing an image filename `file.jpg'.

Expected results:
successful file conversion

Additional info:
It seems like the
changes coders/pdf.c to insert one less string into the ``delegate
command'' format string

@@ -504,7 +517,7 @@ static Image *ReadPDFImage(const ImageIn
   (void) FormatMagickString(command,MaxTextExtent,
     read_info->antialias != MagickFalse ? 4 : 1,
-    read_info->antialias != MagickFalse ? 4 : 1,geometry,density,options,
+    read_info->antialias != MagickFalse ? 4 : 1,density,options,

There's corresponding changes to the delegates.xml file, like

-  <delegate decode="ps:alpha" stealth="True" command='"@PSDelegate@" -q dBATCH -dSAFER -dMaxBitmap=500000000 -dNOPAUSE -dAlignToPixels=0 -dEPSCrop -sDEVICE=@GSAlphaDevice@" -dTextAlphaBits=%u -dGraphicsAlphaBits=%u "-g%s" -r%s" %s "-sOutputFile=%s" "-f%s" "-f%s"' />

+  <delegate decode="ps:alpha" stealth="True" command='"@PSDelegate@" -q dBATCH -dSAFER -dMaxBitmap=500000000 -dNOPAUSE -dAlignToPixels=0 -dEPSCrop -sDEVICE=@GSAlphaDevice@" -dTextAlphaBits=%u -dGraphicsAlphaBits=%u "-r%s" %s "-sOutputFile=%s" "-f%s" "-f%s"' />

where the "-g%s" token has been dropped

Unfortunately, coders/ps.c uses the same delegates, and wasn't updated
accordingly, so, at a minimum, something like the attached needs to be
done to that file.  (I say, ``like,'' because ps.c might also call for
the same ``rotate fix'' that pdf.c did, and not just this band-aid that
fixes the regression.  Also, i haven't actually compiled or tested the
patched code)
Comment 1 Buck Huppmann 2012-03-29 15:02:24 EDT
Created attachment 573768 [details]

should have hung a space after the -g option, as the
PDF patch does (at line 489 of pdf.c)
Comment 3 Buck Huppmann 2012-05-14 08:53:20 EDT
i reckon this is probably the same as bz804546 referenced in


or bz797364 referenced in the RPM changelog for revision -13.el5

but, of course, i can't see those bz's cause they're private, so
i don't know for sure if this is a duplicate
Comment 4 Bryan Mason 2012-05-14 13:19:30 EDT
Yes, this is a duplicate of Bug 804546 and should be fixed in ImageMagick- as described in the Erratum you referenced.
Comment 5 Bryan Mason 2013-04-02 13:17:59 EDT

*** This bug has been marked as a duplicate of bug 804546 ***

Note You need to log in before you can comment on or make changes to this bug.