Page 1 of 1

Different behavior on "convert" command from PDF to JPEG

Posted: 2018-12-17T07:05:00-07:00
by GuillaumeV
Hello,
I have a problem when I try to convert the first page of a PDF file to JPEG format (My PDF has only one page).
The problem is Debian Stetch (9.6) but works perfectly on Debian Jessie (8.11)
On Debian 9.6: ImageMagik v6.9.7.4 and ghostscript v9.26
On Debian 8.11: ImageMagik 6.8.9.9 and ghostscript v9.06

My commande is:

Code: Select all

convert -background white -flatten -verbose my_document.pdf[0] first_page_image.jpg
I get the following error (debian 9.6):

Code: Select all

'gs' -sstdout=%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 '-sDEVICE=pngalpha' -dTextAlphaBits=4 -dGraphicsAlphaBits=4 '-r72x72' -dFirstPage=1 -dLastPage=1 '-sOutputFile=/tmp/magick-24544bcD8YtyhXQl6%d' '-f/tmp/magick-24544nUmUzh3QTriM' '-f/tmp/magick-24544gES4ltaz3bfs'

convert-im6.q16: FailedToExecuteCommand `'gs' -sstdout=%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 '-sDEVICE=pngalpha' -dTextAlphaBits=4 -dGraphicsAlphaBits=4 '-r72x72' -dFirstPage=1 -dLastPage=1 '-sOutputFile=/tmp/magick-24544bcD8YtyhXQl6%d' '-f/tmp/magick-24544nUmUzh3QTriM' '-f/tmp/magick-24544gES4ltaz3bfs'' (-1) 
@ error/delegate.c/ExternalDelegateCommand/462.

If I remove the brackets ( [0] ), it works ! I don't have any issue in previous version (On jessie)
It works with simple PDF file (without large image), I don't understand where there's a problem...

Command without brackets :

Code: Select all

convert -background white -flatten -verbose my_document.pdf first_page_image.jpg
Results:

Code: Select all

'gs' -sstdout=%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 '-sDEVICE=pngalpha' -dTextAlphaBits=4 -dGraphicsAlphaBits=4 '-r72x72'  '-sOutputFile=/tmp/magick-246685XMcGXEIFltr%d' '-f/tmp/magick-24668DrKi6QQcaRoP' '-f/tmp/magick-24668mhqyYAQB3ukd'
/tmp/magick-246685XMcGXEIFltr1 PNG 595x842 595x842+0+0 8-bit sRGB 192KB 0.010u 0:00.010
my_document.pdf PDF 595x842 595x842+0+0 16-bit sRGB 192KB 0.000u 0:00.000
my_document.pdf=>first_page_image.jpg PDF 595x842 595x842+0+0 16-bit sRGB 81.7KB 0.040u 0:00.019
> It works fine.. Any idea ? I don't find any issue talking about this...
Thanks a lot !

Re: Different behavior on "convert" command from PDF to JPEG

Posted: 2018-12-17T07:09:39-07:00
by snibgo
See the recent bug report viewtopic.php?f=3&t=35121

Re: Different behavior on "convert" command from PDF to JPEG

Posted: 2018-12-17T07:22:24-07:00
by GuillaumeV
snibgo wrote: 2018-12-17T07:09:39-07:00 See the recent bug report viewtopic.php?f=3&t=35121
Thanks, I'll read this, but after many attempts to isolate the problem, I finally found that it was because I had a gradient color strip/banner on top document...
It works when the color is united..