[gimp] fix animation layer order when saving as webp



commit 26a6a39b6b4de6083f82c3f5c5786ea14bbabc93
Author: Pascal Massimino <pascal massimino gmail com>
Date:   Tue Oct 25 15:12:07 2016 +0200

    fix animation layer order when saving as webp

 plug-ins/file-webp/file-webp-save.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/plug-ins/file-webp/file-webp-save.c b/plug-ins/file-webp/file-webp-save.c
index d07e0ca..b864296 100644
--- a/plug-ins/file-webp/file-webp-save.c
+++ b/plug-ins/file-webp/file-webp-save.c
@@ -437,9 +437,10 @@ save_animation (const gchar    *filename,
           WebPConfig        config;
           WebPPicture       picture;
           WebPMemoryWriter  mw = { 0 };
+          gint32            drawable = allLayers[nLayers - 1 - loop];
 
           /* Obtain the drawable type */
-          has_alpha = gimp_drawable_has_alpha (allLayers[loop]);
+          has_alpha = gimp_drawable_has_alpha (drawable);
 
           if (has_alpha)
             format = babl_format ("R'G'B'A u8");
@@ -449,10 +450,10 @@ save_animation (const gchar    *filename,
           bpp = babl_format_get_bytes_per_pixel (format);
 
           /* fix layers to avoid offset errors */
-          gimp_layer_resize_to_image_size (allLayers[loop]);
+          gimp_layer_resize_to_image_size (drawable);
 
           /* Retrieve the buffer for the layer */
-          geglbuffer = gimp_drawable_get_buffer (allLayers[loop]);
+          geglbuffer = gimp_drawable_get_buffer (drawable);
           extent = *gegl_buffer_get_extent (geglbuffer);
           w = extent.width;
           h = extent.height;


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