[gimp] Bug 754727 - gimp 2.9.1 git compilation fails in file-psd



commit 67597f42adb79f5374c4533c7e82cea5906c8f36
Author: Michael Natterer <mitch gimp org>
Date:   Tue Sep 8 18:54:02 2015 +0200

    Bug 754727 - gimp 2.9.1 git compilation fails in file-psd
    
    Fix some glitches in patches I recently applied blindly :)

 plug-ins/file-psd/psd-layer-res-load.c |    6 ++++--
 plug-ins/file-psd/psd-save.c           |   29 ++++++++++++++++-------------
 2 files changed, 20 insertions(+), 15 deletions(-)
---
diff --git a/plug-ins/file-psd/psd-layer-res-load.c b/plug-ins/file-psd/psd-layer-res-load.c
index 582aaa7..dea554d 100644
--- a/plug-ins/file-psd/psd-layer-res-load.c
+++ b/plug-ins/file-psd/psd-layer-res-load.c
@@ -854,10 +854,10 @@ load_resource_lyvr (const PSDlayerres  *res_a,
    */
   if (version < 70)
     {
-      g_message ('Invalid version layer');
+      g_message ("Invalid version layer");
     }
 
-
+  return 0;
 }
 
 static gint
@@ -881,4 +881,6 @@ load_resource_lnsr (const PSDlayerres  *res_a,
    * moreover lnsr info is encoded in MacRoman, see
    * https://bugzilla.gnome.org/show_bug.cgi?id=753986#c4
    */
+
+  return 0;
 }
diff --git a/plug-ins/file-psd/psd-save.c b/plug-ins/file-psd/psd-save.c
index f6737e5..6ceca85 100644
--- a/plug-ins/file-psd/psd-save.c
+++ b/plug-ins/file-psd/psd-save.c
@@ -1130,17 +1130,11 @@ write_pixel_data (FILE   *fd,
 {
   GeglBuffer   *buffer = gimp_drawable_get_buffer (drawableID);
   const Babl   *format;
-  if (gimp_item_is_channel(drawableID)) {
-    format = get_channel_format(drawableID);
-  }
-  else {
-    format = get_pixel_format (drawableID);
-  }
-  gint32        tile_height = gimp_tile_height();
+  gint32        tile_height = gimp_tile_height ();
   gint32        height = gegl_buffer_get_height (buffer);
   gint32        width  = gegl_buffer_get_width (buffer);
-  gint32        bytes = babl_format_get_bytes_per_pixel (format);
-  gint32        colors = bytes;       /* fixed up down below */
+  gint32        bytes;
+  gint32        colors;
   gint32        y;
   gint32        len;                  /* Length of compressed data */
   gint16       *LengthsTable;         /* Lengths of every compressed row */
@@ -1152,15 +1146,24 @@ write_pixel_data (FILE   *fd,
   IFDBG printf (" Function: write_pixel_data, drw %d, lto %d\n",
                 drawableID, ltable_offset);
 
-  if ( gimp_drawable_has_alpha  (drawableID) &&
-      !gimp_drawable_is_indexed (drawableID))
-    colors -= 1;
+  if (gimp_item_is_channel (drawableID))
+    format = get_channel_format (drawableID);
+  else
+    format = get_pixel_format (drawableID);
+
+   bytes = babl_format_get_bytes_per_pixel (format);
+
+   colors = bytes;
+
+   if (gimp_drawable_has_alpha  (drawableID) &&
+       ! gimp_drawable_is_indexed (drawableID))
+     colors -= 1;
 
   LengthsTable = g_new (gint16, height);
   rledata = g_new (guchar, (MIN (height, tile_height) *
                             (width + 10 + (width / 100))));
 
-  data = g_new (guchar, MIN(height, tile_height) * width * bytes);
+  data = g_new (guchar, MIN (height, tile_height) * width * bytes);
 
   for (i = 0; i < bytes; i++)
     {


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