mirror of https://github.com/GNOME/gimp.git
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.
This commit is contained in:
parent
b3d5985c72
commit
b663b8058f
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue