jcupitt/libvips — pull request #151 by lovell (2014-08-07 07:46:23+00:00)
Title: Prevent libpng verifying sRGB profiles

Hi John,

I was alerted via https://github.com/lovell/sharp/issues/73 that _libpng_, your favourite PNG library, is more strict with its colour profile verification from v1.6.11 onwards. This means PNG images output from obscure applications such as _Photoshop_ are no longer readable by default.

Luckily the `PNG_SKIP_sRGB_CHECK_PROFILE` option has been provided and is already in use by _[Imagemagick](https://subversion.imagemagick.org/subversion/ImageMagick/trunk/coders/png.c)_.

Here's an example of the current failure:

> curl -O https://cloud.githubusercontent.com/assets/3495674/3804621/1027e86e-1c29-11e4-8bcb-fdc8032a125e.png
> $ vips im_copy 1027e86e-1c29-11e4-8bcb-fdc8032a125e.png out.png
> vipspng: iCCP: known incorrect sRGB profile
> vipspng: known incorrect sRGB profile
> vips2png: unable to write "out.png"

The patch in this Pull Request allows the image to be processed without error.

Cheers,
Lovell