For image manipulation ImageMagick (IM) is really nice. However IM is not natively supported by PHP. Kohana supports IM using a shell wrapper simply because that is the only way to support IM without PECL dependancies.
While this means we can't use Imagick (the PECL extension) using the official Kohana release, this doesn't mean we can't write our own Kohana Image driver. Since I have total freedom on my servers I wanted to use Imagick instead of the shell wrapper and wrote a Imagick driver.
Today I've encountered the jpeg format and the conversion between CMYK and RGB.
I'm working with ImageMagick and the struggle to view 'corrupted images' at least that is what Firefox and Internet Explorer try to tell us.
But in fact they just can't read CMYK. And I don't blame them, they have no business reading it anyway, they should stick to RGB.
The command turned out to be quite simple:
convert myCMYKimage.jpg \ -colorspace rgb \ ...
The colors however aren't all that great, in fact if you plan on using it seriously they plain s*ck, but all in all I blame that on the user who uploads it, not the 'failing' of the browsers or IM in this part.
IM supports much more advanced way in converting to RGB, using color profiles, etc. But this script is used in a public upload system and I'm not planning to fix something the user should have taken care of!
Thanks to ##imagemagick on freenode IRC who helped me with this.
« previous page
(Page 1 of 1, totaling 2 entries)
next page » Frontpage