'unrecognized color string' exception depending on Imagick version

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
snorri
Posts: 1
Joined: 2016-09-20T03:44:51-07:00
Authentication code: 1151

'unrecognized color string' exception depending on Imagick version

Post 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.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post by snibgo »

I don't know Imagick. In ImageMagick, "-colorize" takes two arguments: a colour, and a number. Not two colours.
snibgo's IM pages: im.snibgo.com
Post Reply