Menu

#9 pngcrush sRGB profile error

None
closed
1
2016-10-30
2016-10-27
Andrei
No

Trying to use pngcrush on the attached "example.png" file, but it fails:

$ pngcrush --version
 pngcrush 1.8.9, uses libpng 1.6.26 and zlib 1.2.8.1-motley
 Check http://pmt.sf.net/
 for the most recent version.
CPU time decode 0.000000, encode 0.000000, other 0.000000, total 0.000000 sec

$ pngcrush -ow -brute -fix -warn example.png
example.png: iCCP: Not recognizing known sRGB profile that has been edited
While converting example.png to pngout.png:
  pngcrush caught libpng error:
   known incorrect sRGB profile

What can be done to fix this?

1 Attachments

Discussion

  • Andrei

    Andrei - 2016-10-27

    This ticket may be closed. I have found a convenient solution on StackOverflow:

    $ pngcrush -ow -brute -warn -rem allb example.png
    
     
  • Glenn Randers-Pehrson

    I'll leave it open for a little while. There is some interaction with libpng-1.6.26 (pngrutil.c) that I don't quite understand. pngrutil.c from libpng-1.6.25 doesn't exhibit the problem.

     
  • Glenn Randers-Pehrson

    Fixed in the pngcrush GIT repo. It was necessary to restrict the new ADLER32-skipping feature to work only with IDAT chunks.

     
  • Andrei

    Andrei - 2016-10-30

    Thanks, confirming that it works:

    $ ./pngcrush.exe --version
     pngcrush 1.8.10, uses libpng 1.6.26 and zlib 1.2.8.1-motley
     Check http://pmt.sf.net/
     for the most recent version.
    CPU time decode 0.000000, encode 0.000000, other 0.000000, total 0.000000 sec
    
    $ ./pngcrush -brute -warn example.png example_c.png
    example.png: iCCP: known incorrect sRGB profile
    
    $ du -bh example*.png
    348K    example.png
    297K    example_c.png
    

    On an unrelated note (which doesn't deserve its own ticket), I noticed that the resulting executable is not stripped. On my system, stripping removes more than 200K from pngcrush.exe. Is this not desirable for all Windows users downloading the binaries?

    $ strip -o pngcrush_stripped.exe pngcrush.exe
    $ du -bh pngcrush*.exe
    888K    pngcrush.exe
    604K    pngcrush_stripped.exe
    
     
  • Glenn Randers-Pehrson

    Thanks. I've added strip to my build script and replaced the 1.8.10 executables.

     
  • Glenn Randers-Pehrson

    • status: open --> closed
    • assigned_to: Glenn Randers-Pehrson
    • Group: -->
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.