[gimp] file-jpeg: explicitely set babl_format when loading the image
- From: Massimo Valentini <mvalentini src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] file-jpeg: explicitely set babl_format when loading the image
- Date: Fri, 17 May 2013 16:07:30 +0000 (UTC)
commit a6c00399e81a54ba29cad5f81de0ae42dcaf1ada
Author: Massimo Valentini <mvalentini src gnome org>
Date: Fri May 17 18:00:17 2013 +0200
file-jpeg: explicitely set babl_format when loading the image
when loading the image used for the preview,
it could be different from that of the layer
(u8 vs float for example)
plug-ins/file-jpeg/jpeg-load.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/plug-ins/file-jpeg/jpeg-load.c b/plug-ins/file-jpeg/jpeg-load.c
index be8fd40..0ed9269 100644
--- a/plug-ins/file-jpeg/jpeg-load.c
+++ b/plug-ins/file-jpeg/jpeg-load.c
@@ -86,6 +86,7 @@ load_image (const gchar *filename,
GimpImageBaseType image_type;
GimpImageType layer_type;
GeglBuffer *buffer = NULL;
+ const Babl *format;
gint tile_height;
gint scanlines;
gint i, start, end;
@@ -415,6 +416,7 @@ load_image (const gchar *filename,
*/
buffer = gimp_drawable_get_buffer (layer_ID);
+ format = babl_format (image_type == GIMP_RGB ? "R'G'B' u8" : "Y' u8");
while (cinfo.output_scanline < cinfo.output_height)
{
@@ -434,7 +436,7 @@ load_image (const gchar *filename,
gegl_buffer_set (buffer,
GEGL_RECTANGLE (0, start, cinfo.output_width, scanlines),
0,
- NULL,
+ format,
buf,
GEGL_AUTO_ROWSTRIDE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]