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)
5.8
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Benjamin Tissoires
Desktop QE
:
Depends On:
Blocks:
  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-6.2.8.0-15.el5_8
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-04-02 13:17:59 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
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):
ImageMagick-6.2.8.0-12.el5

How reproducible:
convert file.ps file.whatever

Steps to Reproduce:
1.
2.
3.
  
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
    ImageMagick-6.2.8-rotate-PDF.patch
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,
     GetDelegateCommands(delegate_info),
     read_info->antialias != MagickFalse ? 4 : 1,
-    read_info->antialias != MagickFalse ? 4 : 1,geometry,density,options,
+    read_info->antialias != MagickFalse ? 4 : 1,density,options,
     read_info->filename,postscript_filename,input_filename);
   status=InvokePostscriptDelegate(read_info->verbose,command);
   image=ReadImage(read_info,exception);

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]
revised

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

https://rhn.redhat.com/errata/RHSA-2012-0545.html

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-6.2.8.0-15.el5_8 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.