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?
Asked
Active
Viewed 5,296 times
0

Jeeten Parmar
- 5,568
- 15
- 62
- 111
-
I believe this can happen if png assigns an srgb profile to a black/white or grayscale image. – fmw42 Jan 20 '22 at 02:54
-
@fmw42 The user can upload any file their own so this is not under our control. – Jeeten Parmar Jan 20 '22 at 05:05
-
My comment was not meant as a fix, but only a possible explanation for why you get the message.. – fmw42 Jan 20 '22 at 05:33
2 Answers
0
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:

Tupac
- 2,590
- 2
- 6
- 19
0
I replaced all Image
process related code from System.Drawing
library to MagickImage
and so now, I don't need libpng
.

Jeeten Parmar
- 5,568
- 15
- 62
- 111