Commit 65237901 authored by William Skaggs's avatar William Skaggs
Browse files

Bill Skaggs <weskaggs@primate.ucdavis.edu>

	* app/core/gimpimage-convert.c: applied patch from Adam
	Moss converning gray->indexed conversion,
	fixes bug #170825.
parent 00338c9e
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> 2005-03-20 Sven Neumann <sven@gimp.org>
* app/text/gimptext.[ch] * app/text/gimptext.[ch]
......
...@@ -2051,9 +2051,9 @@ compute_color_gray (QuantizeObj *quantobj, ...@@ -2051,9 +2051,9 @@ compute_color_gray (QuantizeObj *quantobj,
/* Compute representative color for a box, put it in colormap[icolor] */ /* Compute representative color for a box, put it in colormap[icolor] */
{ {
int i, min, max; int i, min, max;
long count; guint64 count;
long total; guint64 total;
long gtotal; guint64 gtotal;
min = boxp->Rmin; min = boxp->Rmin;
max = boxp->Rmax; max = boxp->Rmax;
...@@ -2073,9 +2073,9 @@ compute_color_gray (QuantizeObj *quantobj, ...@@ -2073,9 +2073,9 @@ compute_color_gray (QuantizeObj *quantobj,
if (total != 0) if (total != 0)
{ {
quantobj->cmap[icolor].red = (gtotal + (total >> 1)) / total; quantobj->cmap[icolor].red =
quantobj->cmap[icolor].green = quantobj->cmap[icolor].red; quantobj->cmap[icolor].green =
quantobj->cmap[icolor].blue = quantobj->cmap[icolor].red; quantobj->cmap[icolor].blue = (gtotal + (total >> 1)) / total;
} }
else /* The only situation where total==0 is if the image was null or 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 * all-transparent. In that case we just put a dummy value in
...@@ -2604,8 +2604,7 @@ fill_inverse_cmap_gray (QuantizeObj *quantobj, ...@@ -2604,8 +2604,7 @@ fill_inverse_cmap_gray (QuantizeObj *quantobj,
for (i = 0; i < quantobj->actual_number_of_colors; i++) for (i = 0; i < quantobj->actual_number_of_colors; i++)
{ {
dist = pixel - cmap[i].red; dist = ABS(pixel - cmap[i].red);
dist *= dist;
if (dist < mindist) if (dist < mindist)
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment