simon-git: pix (master): Simon Tatham
Commits to Tartarus CVS repository.
tartarus-commits at lists.tartarus.org
Sat Jan 23 08:58:32 GMT 2016
TL;DR:
c51ca22 Fix palettisation code in pngout.c.
Repository: git://git.tartarus.org/simon/pix.git
On the web: http://tartarus.org/~simon-git/gitweb/?p=pix.git
Branch updated: master
Committer: Simon Tatham <anakin at pobox.com>
Date: 2016-01-23 08:58:32
commit c51ca227f04b8fe7707b0e9066cc43415bdded34
web diff http://tartarus.org/~simon-git/gitweb/?p=pix.git;a=commitdiff;h=c51ca227f04b8fe7707b0e9066cc43415bdded34;hp=6eb86fed4e78aef4b4482270e0c3b2439b7e3a8b
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Jan 23 08:55:59 2016 +0000
Fix palettisation code in pngout.c.
I had a fairly simplistic technique for buliding up a list of the
colours used in the image, by linearly scanning an array but also
moving the most recently seen entry to the front at every step, in the
hope that in practice that would do better than linear time for most
pixels. Unfortunately, it had a bug in which I was constantly just
copying the same colour into every position of the array most of the
time, ahem.
I have to suppose that I hadn't noticed before because _most_ images
fail the 'can we use a small palette?' test, and if the output image
type is set to non-paletted then they never need to actually look a
colour up in this corrupted array at output time. But if an image with
few enough colours managed to pass the initial test somehow, then it
would get to the runtime failure.
pngout.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
More information about the tartarus-commits
mailing list