Bill Skaggs <weskaggs@primate.ucdavis.edu>

* app/core/gimpimage-convert.c: applied patch from Adam
	Moss converning gray->indexed conversion,
	fixes bug #170825.
This commit is contained in:
William Skaggs 2005-03-20 18:57:10 +00:00
parent 00338c9ef4
commit 65237901af
2 changed files with 13 additions and 8 deletions

View File

@ -1,3 +1,9 @@
2005-03-20 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* app/core/gimpimage-convert.c: applied patch from Adam
Moss converning gray->indexed conversion,
fixes bug #170825.
2005-03-20 Sven Neumann <sven@gimp.org>
* app/text/gimptext.[ch]

View File

@ -2051,9 +2051,9 @@ compute_color_gray (QuantizeObj *quantobj,
/* Compute representative color for a box, put it in colormap[icolor] */
{
int i, min, max;
long count;
long total;
long gtotal;
guint64 count;
guint64 total;
guint64 gtotal;
min = boxp->Rmin;
max = boxp->Rmax;
@ -2073,9 +2073,9 @@ compute_color_gray (QuantizeObj *quantobj,
if (total != 0)
{
quantobj->cmap[icolor].red = (gtotal + (total >> 1)) / total;
quantobj->cmap[icolor].green = quantobj->cmap[icolor].red;
quantobj->cmap[icolor].blue = quantobj->cmap[icolor].red;
quantobj->cmap[icolor].red =
quantobj->cmap[icolor].green =
quantobj->cmap[icolor].blue = (gtotal + (total >> 1)) / total;
}
else /* The only situation where total==0 is if the image was null or
* all-transparent. In that case we just put a dummy value in
@ -2604,8 +2604,7 @@ fill_inverse_cmap_gray (QuantizeObj *quantobj,
for (i = 0; i < quantobj->actual_number_of_colors; i++)
{
dist = pixel - cmap[i].red;
dist *= dist;
dist = ABS(pixel - cmap[i].red);
if (dist < mindist)
{