Home > Software design >  libpng warning: iCCP: known incorrect sRGB profile in .NET Core
libpng warning: iCCP: known incorrect sRGB profile in .NET Core

Time:01-20

We have .NET Core application which is hosted under Linux based Docker container. System.Drawing library wasn't working here so we needed to installed libpng with command apt-get install -y --no-install-recommends libgdiplus libc6-dev.

It sorted out image problem but we can see lots of warnings in CloudWatch like libpng warning: iCCP: known incorrect sRGB profile. We also tried to set LogLevel "System.Drawing": "Error" but no luck.

Is there any way we can completely avoid this messages?

CodePudding user response:

Libpng-1.6 onwards is stricter in checking ICC profiles than previous versions. This warning is printed every time a broken png is found. This warning can be ignored and fixes will include:

1.Downgrade to an older version of libpng
2.Install imagemagick and use convert -strip to convert all .png files (script below)

A script that will change all .png files in the current directory:

for f in $(find . -type f -name "*.png")
do
echo "Processing $f ..."
convert $f -strip $f
done

More can refer to this post:

libpng warning: iCCP: known incorrect sRGB profile

CodePudding user response:

I replaced all Image process related code from System.Drawing library to MagickImage and so now, I don't need libpng.

  •  Tags:  
  • Related