Commit 637def4d authored by Michael Schumacher's avatar Michael Schumacher Committed by Michael Schumacher

applied a patch by David Gowers, which makes palette-map behave the same

2005-08-27  Michael Schumacher  <schumaml@cvs.gnome.org>

	* plug-ins/common/gradmap.c: applied a patch by David Gowers,
	which makes palette-map behave the same as gradient-map. Fixes bug
	313458.
parent 48563b9c
2005-08-27 Michael Schumacher <schumaml@cvs.gnome.org>
* plug-ins/common/gradmap.c: applied a patch by David Gowers,
which makes palette-map behave the same as gradient-map. Fixes bug
313458.
2005-08-27 Sven Neumann <sven@gimp.org>
* plug-ins/jpeg/jpeg-load.c (load_image)
......
......@@ -313,6 +313,8 @@ get_samples_palette (GimpDrawable *drawable)
gint bpp, color, has_alpha, alpha;
gint i;
gint num_colors;
gfloat factor;
gint pal_entry;
palette_name = gimp_context_get_palette ();
gimp_palette_get_info (palette_name, &num_colors);
......@@ -323,13 +325,14 @@ get_samples_palette (GimpDrawable *drawable)
alpha = (has_alpha ? bpp - 1 : bpp);
byte_samples = g_new (guchar, NSAMPLES * bpp);
factor = ( (float) num_colors) / NSAMPLES;
for (i = 0; i < NSAMPLES; i++)
{
b_samp = &byte_samples[i * bpp];
if (i < num_colors)
gimp_palette_entry_get_color (palette_name, i, &color_sample);
pal_entry = CLAMP( (int)(i * factor), 0, num_colors);
gimp_palette_entry_get_color (palette_name, pal_entry, &color_sample);
if (color)
gimp_rgb_get_uchar (&color_sample,
......
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