Commit b4710712 authored by Michael Natterer's avatar Michael Natterer 😴

plug-ins: fix indexed palette handling in lcms.c

gimp_image_get/set_colormap() returns/takes the number of bytes in the
colormap, not the number of colors.
parent 24ff9585
......@@ -1118,10 +1118,10 @@ lcms_image_transform_indexed (gint32 image,
cmsHTRANSFORM transform;
guchar *cmap;
gint num_colors;
gint n_cmap_bytes;
cmsUInt32Number format = TYPE_RGB_8;
cmap = gimp_image_get_colormap (image, &num_colors);
cmap = gimp_image_get_colormap (image, &n_cmap_bytes);
transform = cmsCreateTransform (src_profile, format,
dest_profile, format,
......@@ -1131,7 +1131,7 @@ lcms_image_transform_indexed (gint32 image,
if (transform)
cmsDoTransform (transform, cmap, cmap, num_colors);
cmsDoTransform (transform, cmap, cmap, n_cmap_bytes / 3);
cmsDeleteTransform (transform);
......@@ -1140,7 +1140,7 @@ lcms_image_transform_indexed (gint32 image,
g_warning ("cmsCreateTransform() failed!");
gimp_image_set_colormap (image, cmap, num_colors);
gimp_image_set_colormap (image, cmap, n_cmap_bytes);
static cmsHPROFILE
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