pngquant is distributed in "SLOW (debug) version"

Bug #1306426 reported by Uqbar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pngquant (Debian)
Fix Released
Undecided
Unassigned
pngquant (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

pngquant is distributed with a binary compiled with debug options in, thus yielding to slow execution.
Please fix this. How to check.

Install pngquant and run it from conmmand line with no arguments:

pngquant, 1.8.3 (February 2013), by Greg Roelofs, Kornel Lesinski.
   DEBUG (slow) version.
   Compiled with SSE2 instructions.
   Compiled with libpng 1.2.49; using libpng 1.2.49.

usage: pngquant [options] [ncolors] [pngfile [pngfile ...]]

options:
  --force overwrite existing output files (synonym: -f)
  --nofs disable Floyd-Steinberg dithering
  --ext new.png set custom suffix/extension for output filename
  --speed N speed/quality trade-off. 1=slow, 3=default, 10=fast & rough
  --quality min-max don't save below min, use less colors below max (0-100)
  --verbose print status messages (synonym: -v)
  --iebug increase opacity to work around Internet Explorer 6 bug
  --transbug transparent color will be placed at the end of the palette

Quantizes one or more 32-bit RGBA PNGs to 8-bit (or smaller) RGBA-palette
PNGs using Floyd-Steinberg diffusion dithering (unless disabled).
The output filename is the same as the input name except that
it ends in "-fs8.png", "-or8.png" or your custom extension (unless the
input is stdin, in which case the quantized image will go to stdout).
The default behavior if the output file exists is to skip the conversion;
use --force to overwrite.

ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: pngquant 1.8.3-1
Uname: Linux 3.12.4-pf- x86_64
ApportVersion: 2.12.5-0ubuntu2.2
Architecture: amd64
Date: Fri Apr 11 09:40:35 2014
InstallationDate: Installed on 2014-03-28 (13 days ago)
InstallationMedia: Kubuntu 13.10 "Saucy Salamander" - Release amd64 (20131016.1)
MarkForUpload: True
SourcePackage: pngquant
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
Uqbar (uqbar) wrote :
Revision history for this message
Nelson A. de Oliveira (naoliv) wrote :

Actually not.
It only means that it was compiled with NDEBUG defined.

Changed in pngquant (Ubuntu):
status: New → Invalid
Revision history for this message
Uqbar (uqbar) wrote :

Are you sure DEBUG means that they used NDEBUG to compile?
This is at least weird as the program also states it is "DEBUG (slow) version".

Revision history for this message
Nelson A. de Oliveira (naoliv) wrote :

Or NDEBUG isn't defined :-)

    fprintf(fd, "pngquant, %s, by Greg Roelofs, Kornel Lesinski.\n"
        #ifndef NDEBUG
                    " DEBUG (slow) version.\n"
        #endif

But anyway, it's only a message.

Revision history for this message
Uqbar (uqbar) wrote :

Nelson, you are definitely right. That nessage is as uselss as pointless.
Sorry for bothering.

Revision history for this message
Uqbar (uqbar) wrote :

NDEBUG has also the interesting side effect to disable the code that's in the assert() macros.

[uqbar@Feynman ~/Files/000_Software/pngquant-2.1.0/lib] grep assert *.[hc]
blur.c: assert(size > 0);
libimagequant.c: assert(0 == (((uintptr_t)ptr) & 15));
libimagequant.c: assert(offset > 0 && offset <= 16);
libimagequant.c: assert(callback);
libimagequant.c: assert(temp_row);
libimagequant.c: assert(img->temp_row);
libimagequant.c: assert(row_f_pixels);
libimagequant.c: assert(!USE_SSE || 0 == ((uintptr_t)row_f_pixels & 15));
libimagequant.c: assert(omp_get_thread_num() == 0);
mediancut.c: assert(!isnan(r) && !isnan(g) && !isnan(b) && !isnan(a));
mempool.c:#include <assert.h>
mempool.c: assert(!(((uintptr_t)(*mptr) + (*mptr)->used) & ALIGN_MASK));
nearest.c: assert(colorsused < 2 || colors[0].radius <= colors[1].radius); // closest first
nearest.c: assert(map->colors > 0);
nearest.c: assert(likely_colormap_index < centroids->map->colors);
nearest.c: assert(heads[i].num_candidates);
pam.h:#include <assert.h>
pam.h: assert(fabs(res - colordifference_stdc(px,py)) < 0.001);

All that code get disabled by defining NDEBUG.
I suspect the impact can be relevant, especially from mr. Kornel Lesiński feedbacks...

Changed in pngquant (Ubuntu):
status: Invalid → New
Revision history for this message
Uqbar (uqbar) wrote :

So, my comment#5 is totally bullshit. I wish I could delete it.

Revision history for this message
Nelson A. de Oliveira (naoliv) wrote :

Right, the asserts :-)
Good catch.

Revision history for this message
Nelson A. de Oliveira (naoliv) wrote :

It was fixed in Debian unstable. Thanks for spotting this, uqbar.

Changed in pngquant (Debian):
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pngquant - 2.1.0-1

---------------
pngquant (2.1.0-1) unstable; urgency=low

  [ Andreas Tille ]
  * debian/copyright: Changed e-mail address of upstream as requested

  [ Jackson Doak ]
  * New upstream release. Closes: #736215
  * debian/control: Bump standards-version to 3.9.5
  * Use upstream's manpage instead of our own

  [ Nelson A. de Oliveira ]
  * Pass NDEBUG when building the binary (LP: #1306426)

 -- Andreas Tille <email address hidden> Fri, 11 Apr 2014 23:57:49 +0200

Changed in pngquant (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.