[gimp] Bug 734705 - v2.9.1 crashes when scaling an image in indexed colors mode
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Bug 734705 - v2.9.1 crashes when scaling an image in indexed colors mode
- Date: Fri, 15 Aug 2014 07:24:14 +0000 (UTC)
commit b663b8058f8828493f3a3b4c5c0bd131daf025a6
Author: Michael Natterer <mitch gimp org>
Date: Fri Aug 15 09:23:02 2014 +0200
Bug 734705 - v2.9.1 crashes when scaling an image in indexed colors mode
Use gimp_image_get_format() instead of gimp_babl_format() in
gimp_drawable_real_estimate_memsize() because the latter can't handle
indexed formats and returns NULL.
app/core/gimpdrawable.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/app/core/gimpdrawable.c b/app/core/gimpdrawable.c
index f456a30..1dffdc9 100644
--- a/app/core/gimpdrawable.c
+++ b/app/core/gimpdrawable.c
@@ -765,11 +765,14 @@ gimp_drawable_real_estimate_memsize (const GimpDrawable *drawable,
gint width,
gint height)
{
+ GimpImage *image = gimp_item_get_image (GIMP_ITEM (drawable));
+ gboolean linear = gimp_drawable_get_linear (drawable);
const Babl *format;
- format = gimp_babl_format (gimp_drawable_get_base_type (drawable),
- gimp_babl_precision (component_type, FALSE),
- gimp_drawable_has_alpha (drawable));
+ format = gimp_image_get_format (image,
+ gimp_drawable_get_base_type (drawable),
+ gimp_babl_precision (component_type, linear),
+ gimp_drawable_has_alpha (drawable));
return (gint64) babl_format_get_bytes_per_pixel (format) * width * height;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]