I have an image being rejected by the eBay API because of this:
<ShortMessage>Source picture uses an unsupported colorspace.</ShortMessage>
<LongMessage>Pictures with a CMYK colorspace are not supported; source pictures must use a RGB colorspace compatible with all web browsers supported by eBay. Submit pictures created using a camera or scanner set to save images with RGB color.</LongMessage>
Well, I had no idea it was a CMYK nor am I even sure how to tell. I then used the following code to attempt a convert:
$image= "$img.jpg";
$i = new Imagick($image);
$i->setImageColorspace(Imagick::COLORSPACE_SRGB);
$i->writeImage($image);
$i->destroy();
It converts (and is now accepted by eBay), but it also inverts the colors of the picture. Why would it do this and is there another COLORSPACE
I should be using?
Thanks.
The setImageColorSpace method is not meant to be used for existing images - it's only for new images (e.g. $imagick->newPseudoImage(100, 100, "xc:gray");
)
The transformImageColorSpace method is the right one to use for changing an existing images colorspace.
$image= "$img.jpg";
$i = new Imagick($image);
$i->transformImageColorspace(Imagick::COLORSPACE_SRGB);
$i->writeImage($image);
$i->destroy();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With