Menu

#69 pngcrush wrongly outputs "100.00% filesize reduction" and other cosmetic issues

None
closed
None
1
2016-08-09
2016-03-29
wintakeall
No

Three mainly cosmetic issues bundled into one report:

  1. This seems so obvious that I'm wondering why it hasn't been fixed long ago and I can't find a bug report. Surely it's wrong that every run of pngcrush ends with either:

  2. if it was able to reduce the size, something like...

    (18.19% critical chunk reduction)
    (100.00% filesize reduction)

...or if it wasn't able to reduce the size:

    (no IDAT change)
    (100.00% filesize reduction)

If for whatever reason it's not trivial to calculate the actual filesize reduction (which should be 0% if there's no reduction), how about just not outputting anything about it at all to avoid the confusion?

  1. If you specify an output filename pngcrush correctly ends with:
   Best pngcrush method        =   7 (ws 15 fm 0 zl 9 zs 0) =      3246
     for output to user-specified-output.png

...where user-specified-output.png is whatever the user specified as output. But if you use the -ow switch it ends:

   Best pngcrush method        =   7 (ws 15 fm 0 zl 9 zs 0) =      3246
     for output to pngout.png

...where pngout.png is just a normally unseen temp file and the real output is by overwriting the user specified input.

  1. The copyright header has a couple of cosmetic formatting issues:
  2. A bunch of superfluous spaces between "(C) 2005" and "Greg Roelofs", possibly intended to align that name with Glenn's name above but if so failing to align.
  3. A triple space between "built with" and "bundled"

  4. In general, the default output seems way too verbose. Wouldn't it be enough to have the 15 lines of copyright and build info only with the -v and maybe -help options?

Discussion

  • wintakeall

    wintakeall - 2016-03-29

    Sorry about the messed up numbering above - kind of ironic in a report about cosmetic output issues. Should be readable still. There were supposed to be 3 numbered issues above:

    1. "100.00% filesize reduction"
    2. "output to pngout.png" with -ow
    3. Various cosmetics re the copyright header

    PS. I'm learning that SourceForge's numbered list markdown restarts after code blocks, and can't be mixed with the generic list markdown. And the previewing is limited, and there's no editing the ticket after posting, only comments.

     

    Last edit: wintakeall 2016-03-29
  • Glenn Randers-Pehrson

    I can't reproduce (1). What's your platform?
    I've fixed (2) in to-be-released version 1.8.1.
    Removed the superfluous spaces in the Copyright line
    The triple-space in the "bundled" line is to align the "built with" and "running with" lines.

    Thanks

     
  • wintakeall

    wintakeall - 2016-04-03

    I can't reproduce (1). What's your platform?

    I'm running Windows 7 SP1 64-bit and using pngcrush_1_8.0_w64.exe and pngcrush_1_8.0_w32.exe downloaded from the official SF distribution.

    Full output of sample test run using the w64 .exe and basn0g01.png from Willem van Schaik's PngSuite (www.schaik.com), but same wrong "(100.00% filesize reduction)" with the w32 exe and with any other .png:

    C:\Test>dir basn0g01.png
    ...
    01/12/2013  16:54               164 basn0g01.png
    ...
    C:\Test>pngcrush_1_8.0_w64.exe -rem alla -ow basn0g01.png
    
     | pngcrush-1.8.0
     |    Copyright (C) 1998-2002, 2006-2016 Glenn Randers-Pehrson
     |    Portions copyright (C) 2005       Greg Roelofs
     | This is a free, open-source program.  Permission is irrevocably
     | granted to everyone to use this version of pngcrush without
     | payment of any fee.
     | Executable name is pngcrush_1_8.0_w64.exe
     | It was built with   bundled libpng-1.6.21
     | and is running with bundled libpng-1.6.21
     |    Copyright (C) 1998-2004, 2006-2016 Glenn Randers-Pehrson,
     |    Copyright (C) 1996, 1997 Andreas Dilger,
     |    Copyright (C) 1995, Guy Eric Schalnat, Group 42 Inc.,
     | and bundled zlib-1.2.8, Copyright (C) 1995-2013,
     |    Jean-loup Gailly and Mark Adler.
     | It was compiled with gcc version 4.8.0 20121031 (experimental).
    
       Reading IHDR chunk.
       Reading gAMA chunk.
       Reading IDAT chunk.
       Reading IEND chunk.
       Recompressing IDAT chunks in basn0g01.png
       Total length of data found in critical chunks           =       148
       Critical chunk length, method   1 (ws 11 fm 0 zl 4 zs 0) =       147
       Critical chunk length, method   2 (ws 11 fm 1 zl 4 zs 0) >       147
       Critical chunk length, method   3 (ws 11 fm 5 zl 4 zs 1) >       147
       Critical chunk length, method   4 (ws 11 fm 0 zl 9 zs 1) >       147
       Critical chunk length, method   7 (ws 11 fm 0 zl 9 zs 0) >       147
       Removed the gAMA chunk.
       Best pngcrush method        =   1 (ws 11 fm 0 zl 4 zs 0) =       147
         for output to pngout.png
         (0.68% critical chunk reduction)
         (100.00% filesize reduction)
    
       CPU time decoding 0.000, encoding 0.001, other 0.052, total 0.053 sec.
    
    
    C:\Test>dir basn0g01.png
    ...
    04/03/2016  16:15               147 basn0g01.png
                   1 File(s)            147 bytes
    
     

    Last edit: wintakeall 2016-04-03
  • Glenn Randers-Pehrson

    Most of these problems are fixed in pngcrush-1.8.1. A remaining error in the filesize report with the "-ow" option will be fixed in pngcrush-1.8.2.

     
  • Glenn Randers-Pehrson

    Fixed in pngcrush-1.8.2

     
  • Glenn Randers-Pehrson

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

Log in to post a comment.

MongoDB Logo MongoDB