How to solve the errors: ibpng warning iccp known incorrect srgb profile, wrong file, file does not exist in Magento 2

ibpng warning iccp known incorrect srgb profile

“ibpng warning iccp known incorrect srgb profile” is a common error message which users will probable face when working with Magento 2. In this tutorial, Magesolution will digging into this errors and learn how to fix it properly.

ibpng warning iccp known incorrect srgb profile

Magento 2 provide a very useful command to resize images on storefronts to save disk space as well as boost load speed of your Magento site faster.

php bin/magento catalog:images:resize

Some times, the error message ” ibpng warning iccp known incorrect srgb profile” showcase when you resize product images on your Magento 2 storefront as below picture:

ibpng warning iccp known incorrect srgb profile

Cause of the error” ibpng warning iccp known incorrect srgb profile”

When you check the images ICC profiles, Magento 2 did not find iCCP chunk in PNG image profile, thus the system automatically show this error message and stop the image resize process. If you see the above error warning while loading a PNG image, it means the iCCP chunk is present in the image. This is not essentially an issue so you can ignore it. But if you want to fix it, you have to remove the iCCP chunk.

Also read:

How to fix this error ” ibpng warning iccp known incorrect srgb profile”

Solution 1

You will need to use Linux command to remove iCCP chunk from the images. At first, you connect to your server using SSH as root user and follow the below command to remove iCCP chunk from PNG Images on your Magento 2 website. If your images files located in pub/media

find pub/media -type f -iname '*.png' -exec pngcrush -ow -rem allb -reduce {} \;

After that, you need to re-run image resize command and the issue is solved, you now can resize images normally.

If you see the error: Wrong file => that means the files you want to resize do not exist in the folder. Recheck the image files in that folder or you can force Magento 2 to ingore this error and continue the process by editing vendor/magento/module-media-storage/Service/ImageResize.php file and put the following code in line 186

if ($this>mediaDirectory->isFile($originalImagePath) && filesize({path_to_the_file}))

Now all the error should go away and you can process image resize normally

Solution 2

If you are using an app that treats warnings as errors you do have to remove the chunk. You can perform this task any of a variety of PNG editors such as ImageMagick’s.

convert in.png out.png

Also, you can remove the invalid iCCP chunk from all of the PNG files in a folder (directory), you can utilize mogrify from ImageMagick:

mogrify *.png

This requires that your ImageMagick was built with libpng16. If you want to check it, follow the below command.

convert -list format | grep PNG

If you’d like to find out which files need to be solved instead of blindly processing all of them, you can use the following command

pngcrush -n -q *.png

where the -n means don’t rewrite the files and -q means suppress most of the output except for errox. Sorry, there’s no option yet in pngcrush to suppress everything but the warnings.

Conclusion

That’s all about ” ibpng warning iccp known incorrect srgb profile” error and how to fix it . If you face any issue while fixing this error, then feel free to contact our support team for a quick fix.

About us: We  is one of the leading Magento 2 extensions and theme providers. Also, we are one of the best magento web development services providers in the world. With experienced Magento developers, we commit to provide high-quality products and services to help customers achieve their business success.

1006 Total Views 3 Views Today