[gimp] file-tiff-save: Fix indexed image case



commit b65650f8a043389e04a1224c93dfe2d80321a80f
Author: Mukund Sivaraman <muks banu com>
Date:   Tue May 14 18:33:33 2013 +0530

    file-tiff-save: Fix indexed image case

 plug-ins/common/file-tiff-save.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/plug-ins/common/file-tiff-save.c b/plug-ins/common/file-tiff-save.c
index 9e68abd..ecabd78 100644
--- a/plug-ins/common/file-tiff-save.c
+++ b/plug-ins/common/file-tiff-save.c
@@ -742,7 +742,6 @@ save_image (const gchar  *filename,
         format        = babl_format ("R'G'B' u8");
       else
         format        = babl_format ("R'G'B' u16");
-      bytesperrow     = cols * babl_format_get_bytes_per_pixel (format);
       break;
 
     case GIMP_GRAY_IMAGE:
@@ -753,7 +752,6 @@ save_image (const gchar  *filename,
         format        = babl_format ("Y' u8");
       else
         format        = babl_format ("Y' u16");
-      bytesperrow     = cols * babl_format_get_bytes_per_pixel (format);
       break;
 
     case GIMP_RGBA_IMAGE:
@@ -765,7 +763,6 @@ save_image (const gchar  *filename,
         format        = babl_format ("R'G'B'A u8");
       else
         format        = babl_format ("R'G'B'A u16");
-      bytesperrow     = cols * babl_format_get_bytes_per_pixel (format);
       break;
 
     case GIMP_GRAYA_IMAGE:
@@ -776,7 +773,6 @@ save_image (const gchar  *filename,
         format        = babl_format ("Y'A u8");
       else
         format        = babl_format ("Y'A u16");
-      bytesperrow     = cols * babl_format_get_bytes_per_pixel (format);
       break;
 
     case GIMP_INDEXED_IMAGE:
@@ -816,7 +812,7 @@ save_image (const gchar  *filename,
       samplesperpixel = 1;
       bytesperrow     = cols;
       alpha           = FALSE;
-      format          = NULL;
+      format          = gimp_drawable_get_format (layer);
 
       g_free (cmap);
       break;
@@ -829,6 +825,8 @@ save_image (const gchar  *filename,
       goto out;
     }
 
+  bytesperrow = cols * babl_format_get_bytes_per_pixel (format);
+
   if (compression == COMPRESSION_CCITTFAX3 ||
       compression == COMPRESSION_CCITTFAX4)
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]