Page 1 of 2

Problems during label creation

Posted: 2010-05-18T02:21:37-07:00
by beenwa
Hello I have some problems on a command:

convert -background '#000000' \
-fill '#FFFFFF' \
-size 120x \
-font Helvetica \
-gravity Center -wave 5x100 \
-pointsize 72 label:Hello /usr/var/file.png

this command works fine on an old server but doesn't work on a new...

Currently it returns:
CRIT: rangecheck in .setuserparams
Operand stack:
--nostringval-- --nostringval-- --nostringval--
CRIT: rangecheck in .setuserparams
Operand stack:
--nostringval-- --nostringval-- --nostringval--
convert: delegate library support not built-in `/usr/share/fonts/default/Type1/n019003l.pfb' (Freetype) @ warning/annotate.c/RenderFreetype/1449.
convert: Postscript delegate failed `/tmp/magick-XX4erxAH': @ error/ps.c/ReadPSImage/778.
convert: missing an image filename `/var/www/vhosts/host.com/httpdocs/sd_img/captcha/fiche-parcours/20100518112036161.jpg' @ error/convert.c/ConvertImageCommand/2970.


ImageMagick 6.6.1-9 2010-05-18 Q16,
It runs under CentOs Server.

Have you got solutions?

Thanks a lot

Re: Problems during label creation

Posted: 2010-05-18T08:50:04-07:00
by fmw42
looks like you are missing the freetype delegate library

type

convert -list configure

look at line starting with DELEGATES. Does it contain freetype? Here is mine:

DELEGATES bzlib fftw fontconfig freetype gs jpeg jng jp2 lcms lqr mpeg openexr png rsvg tiff x11 xml zlib

Did you install from source or binary? If from binary, you probably don't get freetype automatically. If from source, you have to install all the relevant delegate libraries.

More proper syntax would have -wave just before the output after you finish the label: But does not seem to matter in my tests, which did finish on IM 6.6.1-10 Q16 Mac OSX Tiger

Re: Problems during label creation

Posted: 2010-05-20T01:47:58-07:00
by AxelF1983
I have nearly the same problem:

When i type this command in the console, it runs:
/usr/local/bin/convert -depth 8 -density 300 -profile libs/imagemagick/USWebCoatedSWOP.icc -profile libs/imagemagick/AdobeRGB1998.icc views/default/images/21_bilder/1/19/199/199684A1 PNG: tmp/944762.png

When i execute the command withe exec in a php file i get the errors:
CRIT: rangecheck in .setuserparams
Operand stack:
--nostringval-- --nostringval-- --nostringval--

But no other errors. But imagemagick dont create the picture.

Anybody have any idea?

Re: Problems during label creation

Posted: 2010-05-20T02:08:37-07:00
by snibgo
If you really have a space after "PNG:", remove it. But you don't need "PNG:" anyway.

Re: Problems during label creation

Posted: 2010-05-20T02:27:59-07:00
by AxelF1983
I removed the "PNG". Still the same problem. Same error messages. Here is the full command:

/usr/local/bin/convert -depth 8 -density 300 -profile /srv/www/vhosts/test.myprogram.com/httpdocs/libs/imagemagick/USWebCoatedSWOP.icc -profile /srv/www/vhosts/test.myprogram.com/httpdocs/libs/imagemagick/AdobeRGB1998.icc views/default/images/21_bilder/1/19/199/199684A1 /srv/www/vhosts/test.myprogram.com/httpdocs/./tmp/816716.png

Re: Problems during label creation

Posted: 2010-05-20T02:50:02-07:00
by snibgo
Your command arguments are in a strange order. The general format is:

convert infile options outfile

Can you post the URL of the file 199684A1? What image type is it?

But these comments don't explain why it works from the console but not PHP. The error message doesn't look like ImageMagick; possibly Ghostscript. "setuserparams" sounds like PostScript. Do you have multiple version of Ghostscript installed?

Re: Problems during label creation

Posted: 2010-05-20T03:16:07-07:00
by AxelF1983
It is a EPS file. but it doesnt work with and without extension ".eps".

Yes i have multiple ghostscript version installed. currently i use version 7.05.
the imagemagick version is: 5.5.6 04/01/03 Q16 http://www.imagemagick.org

Re: Problems during label creation

Posted: 2010-05-20T03:36:24-07:00
by snibgo
Then PHP may be using a different Ghostscript from the command-line.

Your Ghostscript and IM are both old. (7 years old ?!) I suggest you upgrade both.

Re: Problems during label creation

Posted: 2010-05-20T04:24:59-07:00
by AxelF1983
Sorry it was the wrong server.

i use these current versions:

ImageMagick 6.6.1-3 2010-04-22 Q16
GPL Ghostscript 8.71 (2010-02-10)

i get still the same Error messages.

Re: Problems during label creation

Posted: 2010-05-20T05:00:55-07:00
by snibgo
One version of Ghostscript, or two? That's the only explanation I can think of for it working from the console but not PHP.

Re: Problems during label creation

Posted: 2010-06-09T03:00:52-07:00
by AxelF1983
Yes, i have two GS-Versions installed. usr/local/share/gs/8.71 and usr/share/gs/8.15

How can I use only one? What i have to do, to told imagemagick to use the correct GS-Version?

Re: Problems during label creation

Posted: 2010-06-09T08:45:44-07:00
by snibgo
I don't know GS or PHP (or even Unix) very well, but I suspect the command line uses the local GS, but PHP uses the system GS.

Perhaps PHP can be configured to use local GS.

Or perhaps you should install the latest GS at the system level.

Re: Problems during label creation

Posted: 2010-06-14T23:14:28-07:00
by anthony
Helvetica is a definate Postscript Font, which means the label generation is going though Ghostscript.

this is rather slow. If you can you should yet to use a TrueType of OpenType font which the 'freetype' library can handle directly.

Re: Problems during label creation

Posted: 2010-07-18T13:54:50-07:00
by AxelF1983
snibgo wrote:I don't know GS or PHP (or even Unix) very well, but I suspect the command line uses the local GS, but PHP uses the system GS.

Perhaps PHP can be configured to use local GS.

Or perhaps you should install the latest GS at the system level.
Thank you very much. I installed the latest GS at the system level. now it runs. Thank you for your help and patience!

Re: Problems during label creation

Posted: 2010-07-18T14:46:26-07:00
by snibgo
Glad it now works. Thanks for letting us know.