app: add precision argument to gimp_image_get_format()
and use it instead of gimp_babl_format() in some places where indexed formats can occur. Also fix some places using gimp_babl_format() to special case indexed formats correctly.
This commit is contained in:
@ -201,9 +201,13 @@ gimp_buffer_get_new_preview (GimpViewable *viewable,
|
||||
const Babl *format = gimp_buffer_get_format (buffer);
|
||||
GimpTempBuf *preview;
|
||||
|
||||
format = gimp_babl_format (gimp_babl_format_get_base_type (format),
|
||||
GIMP_PRECISION_U8,
|
||||
babl_format_has_alpha (format));
|
||||
if (babl_format_is_palette (format))
|
||||
format = gimp_babl_format (GIMP_RGB, GIMP_PRECISION_U8,
|
||||
babl_format_has_alpha (format));
|
||||
else
|
||||
format = gimp_babl_format (gimp_babl_format_get_base_type (format),
|
||||
GIMP_PRECISION_U8,
|
||||
babl_format_has_alpha (format));
|
||||
|
||||
preview = gimp_temp_buf_new (width, height, format);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user