[gimp/wip/wormnest/issue-6886: 997/997] Change: Allow loading of indexed images with linear precision.
- From: Jehan <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/wip/wormnest/issue-6886: 997/997] Change: Allow loading of indexed images with linear precision.
- Date: Thu, 24 Mar 2022 13:11:03 +0000 (UTC)
commit 3c17505a8479a88e42757104a91520af1baa7440
Author: Jacob Boerema <jgboerema gmail com>
Date: Tue Jul 13 17:27:06 2021 -0400
Change: Allow loading of indexed images with linear precision.
This fixes #6886 where certain indexed png images fail to load.
As far as I can see babl supports loading of indexed linear precision
images, so lets change the checks that prohibited loading of these images.
Also add a console error when precision is not U8 for GIMP_INDEXED.
app/core/gimpimage.c | 5 ++++-
app/gegl/gimp-babl.c | 1 +
2 files changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/app/core/gimpimage.c b/app/core/gimpimage.c
index 22d1dfd04f..6e8393a8e5 100644
--- a/app/core/gimpimage.c
+++ b/app/core/gimpimage.c
@@ -2160,13 +2160,16 @@ gimp_image_get_format (GimpImage *image,
return gimp_babl_format (base_type, precision, with_alpha, space);
case GIMP_INDEXED:
- if (precision == GIMP_PRECISION_U8_NON_LINEAR)
+ if (precision == GIMP_PRECISION_U8_NON_LINEAR ||
+ precision == GIMP_PRECISION_U8_LINEAR)
{
if (with_alpha)
return gimp_image_colormap_get_rgba_format (image);
else
return gimp_image_colormap_get_rgb_format (image);
}
+ else
+ g_printerr ("Error: unhandled precision %d for GIMP_INDEXED", precision);
}
g_return_val_if_reached (NULL);
diff --git a/app/gegl/gimp-babl.c b/app/gegl/gimp-babl.c
index e8bf2647b5..db569817df 100644
--- a/app/gegl/gimp-babl.c
+++ b/app/gegl/gimp-babl.c
@@ -814,6 +814,7 @@ gimp_babl_is_valid (GimpImageBaseType base_type,
switch (precision)
{
case GIMP_PRECISION_U8_NON_LINEAR:
+ case GIMP_PRECISION_U8_LINEAR:
return TRUE;
default:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]