Page 1 of 1

Problem converting pdf to gif

Posted: 2009-06-12T10:44:35-07:00
by vespito
Hi,
when I convert pdfs having white backgrounds I have no problem (working examples):

convert -resize 32x42 -colors 256 "http://www.aspb.cat/quefem/docs/grip_2_6_09.pdf[0]" public_html/qua.gif


but with coloured backgrounds I get strange double size gifs:

convert -resize 32x42 -colors 256 "http://www.aspb.cat/quefem/docs/Indicad ... fico.pdf[0]" public_html/qui.gif

Where is my error? Thank you in advance for any hint. Regards;

Carlo.

Re: Problem converting pdf to gif

Posted: 2009-06-13T03:25:19-07:00
by anthony
First order your options so the operations are performed AFTER reading the image (which is itself an operation.

So try

Code: Select all

convert "http://www.aspb.cat/quefem/docs/Indicadores_morbilidad_accidentes_trafico.pdf[0]" -resize 32x42 -colors 256 public_html/qui.gif
and report if this clears you problem.

It may be that as you are relying on the 'legacy' option handling, the -colors may be
applied BEFORE the -resize operator.

See beginning section of IM Examples Basics
http://www.imagemagick.org/Usage/basics/

Or more specifically
http://www.imagemagick.org/Usage/basics/#legacy

Actually the -colors 256 is probably redundant here, as GIF format, by definition' can not handle more than 256 colors, so IM will automatically do the color reduction for that format.

Re: Problem converting pdf to gif

Posted: 2009-06-15T09:15:57-07:00
by vespito
Moving the options after the image does not solve the problem, sorry.
The -colors 256 is redundant and taking it out does not solve the problem either.
The problem persists also converting to png or to jpg and using -thumbnail or -scale instead of -resize: I always get an image that is half white on the left and half the image itself as it should be, but narrowed, on the right.
I'm surely doing something stupid, but I can't see what. Could you help me?

Re: Problem converting pdf to gif

Posted: 2009-06-15T09:26:02-07:00
by magick
We tried your command with the latest release of ImageMagick, 6.5.3-7, and it worked as expected. We get a half white and half goldish. Perhaps there is a bug in your release of ImageMagick or Ghostscript (we're using GS 8.64).

Re: Problem converting pdf to gif

Posted: 2009-06-15T10:20:43-07:00
by vespito
It should be all goldish! The white part is mistaken, since the first page of the pdf is all goldish.