5

We have the problem, that one image in the catalog is shown negatively in Magento below the gallery.

I tried to reproduce with n98-magerun2 dev:console

$i = $di->create('\Magento\Framework\Image',
  ['fileName' => 'original.jpg']);
$i->open();
$i->resize(90,90);
$i->save('small-repro.jpg');

Which I cant.

While I can reproduce it by

rm product/cache/.... $ rm small.jpg 

and reloading the category page -> it's shown wrong again.

The image also shoes like this when downloading or showing in different browsers, so it seems to be a problem within the server / Magento.

  1. Did anybody see this before?
  2. How can I dig deeper into it?
2
  • Did you find the solution? Commented May 16, 2019 at 13:36
  • Do you have the same problem? Actually I did not find a real solution but deleted that particular image
    – Alex
    Commented May 17, 2019 at 16:21

1 Answer 1

9

This could be down to the image being in the CMYK colour space, Imagick can have issues when working with these images as it is unable to convert to RGB properly.

You can either upload a preconverted image, or trying patching in a way for Magento to deal with this issue with the use of setImageColourSpace and a nice little if around $image->getImageColorspace() == Imagick::COLORSPACE_CMYK to set the correct ICC profile.

2
  • One thing remains strange: Why can I not reproduce it via the simple n98-magerun commands
    – Alex
    Commented Jan 30, 2019 at 12:15
  • in which file I do this change? Commented May 16, 2019 at 6:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.