Page 1 of 1

'unrecognized color string' exception depending on Imagick version

Posted: 2016-09-20T04:11:52-07:00
by snorri
I have a strange problem with 2 Imagick versions.
One version of my script which works perfectly well on a debian server with 3.2.0RC1 raises "unrecognized color string" exception on a ubuntu server with v.3.4.2.

Following line

Code: Select all

$shadowimage->colorizeImage('none', 0.83);
has to be rewritten to

Code: Select all

$shadowimage->colorizeImage('rgba(0, 0, 0, 0)', 'rgba(0, 0, 0, .33)');
because v.3.4.2 accepts only rgb color strings while 3.2.0RC1 accepts hexcode only.
Apart from this the opacity values seem to be interpreted differently! The lines above produce nearly the same output.
Weird!

Any help is appreciated.

Re: 'unrecognized color string' exception depending on Imagick version

Posted: 2016-09-20T04:40:13-07:00
by snibgo
I don't know Imagick. In ImageMagick, "-colorize" takes two arguments: a colour, and a number. Not two colours.