Changing density causes an exeution comand error

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
guysoft
Posts: 12
Joined: 2014-08-25T03:34:17-07:00
Authentication code: 6789

Changing density causes an exeution comand error

Post by guysoft »

Hey,
On certain PDF files, when I run this command with -density 200 like this:

Code: Select all

convert -density 200 "/mnt/git/tmp/E33.pdf" -quality 100 /tmp/aaaa.png
I get this error:

Code: Select all

convert: FailedToExecuteCommand `"gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r200x200"  "-sOutputFile=/tmp/magick-2957kte8nXSWCLOh%d" "-f/tmp/magick-2957ERH_nxorvD7R" "-f/tmp/magick-2957J7WL_niXZyqs"' (-1) @ error/delegate.c/ExternalDelegateCommand/461.
convert: no images defined `/tmp/aaaa.png' @ error/convert.c/ConvertImageCommand/3210.
However,
1. it works fine with -density 100, eg:

Code: Select all

convert -density 100 "/mnt/git/tmp/E33.pdf" -quality 100 /tmp/aaaa.png
Moreover this command works fine on Imagemagick 6.6.9-7 Ubuntu 12.04, but fails on Imagemagick 6.7.7-10 Ubuntu 14.10 and later versions.

Is there a way to debug what gs command is being ran? Is there a way to figure out what is breaking?

Thanks!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Changing density causes an exeution comand error

Post by fmw42 »

IM was undergoing some major changes during the 6.7.7.x versions. Both are very old. Can you upgrade to a more current version. IM is now at 6.9.2.4.

Also -quality 100 does not mean the same thing for PNG as it does for JPG. See http://www.imagemagick.org/script/comma ... hp#quality
guysoft
Posts: 12
Joined: 2014-08-25T03:34:17-07:00
Authentication code: 6789

Re: Changing density causes an exeution comand error

Post by guysoft »

This also happens on later versions, I gave a version where this did not happen, this was to show this is a regression, and not a problem in the pdf (which unfortunately does not belong to me and I can't share).
Just to be safe, I have checked out the git repo and built from the ImageMagick-6 branch. commit e69bdbeba63b2fb25d485383da9d17d4ed78cc0f.
That means I am on the going-to-be 6.9.2-5, the commit is from yesterday.

The error I get now is:

Code: Select all

guy@golem4:~/tmp/ImageMagick$ /opt/imagemagick/bin/convert -density 200 "/mnt/git/tmp/E33.pdf" -quality 100 /tmp/aaaa.png
convert: FailedToExecuteCommand `"gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r200x200"  "-sOutputFile=/tmp/magick-13863--A45JDwYfAj%d" "-f/tmp/magick-138634G1-M1Y0j17F" "-f/tmp/magick-13863cFTsyeXL2RF2"' (-1) @ error/delegate.c/ExternalDelegateCommand/483.
convert: no images defined `/tmp/aaaa.png' @ error/convert.c/ConvertImageCommand/3230.
So now we have the exact source:
http://git.imagemagick.org/repos/ImageM ... d4ed78cc0f

And the line is:
http://git.imagemagick.org/repos/ImageM ... ate.c#L483

This execution is printing something relevant, it looks like the gs command is failing, but I am not sure why from the actual error, is there a way to compare the executed command parameters?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Changing density causes an exeution comand error

Post by fmw42 »

convert: FailedToExecuteCommand `"gs"
Do you have Ghostscript installed (in the right locations for IM to find it) and what version of GS?
guysoft
Posts: 12
Joined: 2014-08-25T03:34:17-07:00
Authentication code: 6789

Re: Changing density causes an exeution comand error

Post by guysoft »

Code: Select all

guy@golem4:~/tmp/ImageMagick$ /usr/bin/gs -version
GPL Ghostscript 9.15 (2014-09-22)
Copyright (C) 2014 Artifex Software, Inc.  All rights reserved.
Just making sure you didnt mess- the command *works* with -quality 100.
How could a parameter effect finding the binary?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Changing density causes an exeution comand error

Post by fmw42 »

Just making sure you didnt mess- the command *works* with -quality 100.
How could a parameter effect finding the binary?
It was just a comment that you might want to review your quality setting as 100 may not be optimal.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Changing density causes an exeution comand error

Post by fmw42 »

This works just fine for me on IM 6.9.2.5 beta Q16 Mac OSX with GS 9.10 and libpng 1.6.12_0

Code: Select all

convert logo: logo.pdf
im6925beta convert logo.pdf -quality 100 logo.png

Perhaps the newer GS you are using is buggy?

Check you delegates.xml file for ps

<delegate decode="ps:alpha" stealth="True" command=""gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=%u -dGraphicsAlphaBits=%u "-r%s" %s "-sOutputFile=%s" "-f%s" "-f%s""/>

<delegate decode="ps:cmyk" stealth="True" command=""gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pamcmyk32" -dTextAlphaBits=%u -dGraphicsAlphaBits=%u "-r%s" %s "-sOutputFile=%s" "-f%s" "-f%s""/>

<delegate decode="ps:color" stealth="True" command=""gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pnmraw" -dTextAlphaBits=%u -dGraphicsAlphaBits=%u "-r%s" %s "-sOutputFile=%s" "-f%s" "-f%s""/>

Do you have the same -sDEVICEs?
guysoft
Posts: 12
Joined: 2014-08-25T03:34:17-07:00
Authentication code: 6789

Re: Changing density causes an exeution comand error

Post by guysoft »

The problem is not quality, its density

Try:

Code: Select all

convert -density 200 "logo.pdf" -quality 100 /tmp/aaaa.png
Note, Had to change from -sDEVICE=pam&quot to -sDEVICE=pamcmyk32" and it did not help
guysoft
Posts: 12
Joined: 2014-08-25T03:34:17-07:00
Authentication code: 6789

Re: Changing density causes an exeution comand error

Post by guysoft »

SOVLED IT!
Checked out ghostscript from the git repo, built that and did a symbolic link, GPL Ghostscript GIT PRERELEASE 9.19 (2015-09-23) fixes it.

There is likely a bug in Ghostscript 9.15
Post Reply