14

When I run my program it gives me the following warning:

libpng warning: iCCP: known incorrect sRGB profile

I know why this is caused, the sRGB is what it wants, but I use adobe photoshop RGB.

Just wondering if there is any code to disable the warning. It doesn't affect my program. It's just annoying.

Any help would be greatly appreciated!

(Please don't ask me to show my code, my code has nothing to do with this situation)

daouzli
  • 15,288
  • 1
  • 18
  • 17
killarviper
  • 165
  • 1
  • 1
  • 8
  • For some reason it stopped happening. But I am going to keep this post open in case anyone wants to answer. – killarviper Jun 20 '14 at 18:40
  • if the warning is printed in `stderr`, you may redirect it to `/dev/null` (under Linux) – daouzli Jun 20 '14 at 18:50
  • If you upgraded libpng to version 1.6.12, the reason it stopped happening is that some of the warnings about incorrect sRGB profiles have been eliminated. – Glenn Randers-Pehrson Jun 21 '14 at 23:44
  • I did not upgrade libpng – killarviper Jun 22 '14 at 04:59
  • This might help you solve the actual issue, rather than just ignoring the warning: [libpng warning: iCCP: known incorrect sRGB profile](https://stackoverflow.com/questions/22745076/libpng-warning-iccp-known-incorrect-srgb-profile) – Shadow May 03 '21 at 00:41

2 Answers2

1

well, you can ignore the warning. I am using ImageMagick for image resizing, and for some png file, the following code will throw exception: iCCP: known incorrect sRGB profile `' @ warning/png.c/MagickPNGWarningHandler/1830

Blob ablob(cont.data(), cont.size()); // cont is the png file content.
Image image;
image.read(ablob);
image.resize( Geometry(100, 100) );

As it says, it's just a warning, you can put the image.read(ablob) in a try{}catch{} block, and ignore the exception. The object image now contains the integrated png data, and can be manipulated correctly.

sparkling
  • 19
  • 2
0

.pyw extensions remove the console. That should do it. You can also see the source code, where it has the warning start.

Aarav Dave
  • 41
  • 1
  • 11