[gimp] plug-ins: fill the background color inconditionally on full image size.



commit a2b438cc8284ba033003a08df0c77e55986b6cd5
Author: Jehan <jehan girinstud io>
Date:   Mon Jun 19 22:30:08 2017 +0200

    plug-ins: fill the background color inconditionally on full image size.
    
    No need to loop through layers, which may be wrong anyway with
    layers-as-pages. Also we were using the layer sizes without even
    checking their offsets yet filling from (0, 0). This code was flawed in
    many aspects.

 plug-ins/common/file-pdf-save.c |   20 +++++---------------
 1 files changed, 5 insertions(+), 15 deletions(-)
---
diff --git a/plug-ins/common/file-pdf-save.c b/plug-ins/common/file-pdf-save.c
index 257930a..3c22113 100644
--- a/plug-ins/common/file-pdf-save.c
+++ b/plug-ins/common/file-pdf-save.c
@@ -553,23 +553,13 @@ run (const gchar      *name,
        * otherwise the output PDF will always show white for background,
        * and may display artifacts at transparency boundaries
        */
-      if (gimp_drawable_has_alpha(layers[n_layers - 1]))
+      if (gimp_drawable_has_alpha (layers[n_layers - 1]))
         {
           GimpRGB color;
-          gint width=0, height=0;
-          for (j = 0; j < n_layers; j++)
-            {
-              gint32 layer_ID   = layers [n_layers - j - 1];
 
-              if (gimp_item_get_visible (layer_ID) &&
-                 (! optimize.ignore_hidden ||
-                  (optimize.ignore_hidden && gimp_layer_get_opacity (layer_ID) > 0.0)))
-                {
-                  width = MAX (width, gimp_drawable_width (layer_ID));
-                  height = MAX (height, gimp_drawable_height (layer_ID));
-                }
-            }
-          cairo_rectangle (cr, 0, 0, width, height);
+          cairo_rectangle (cr, 0.0, 0.0,
+                           gimp_image_width (image_ID),
+                           gimp_image_height (image_ID));
           gimp_context_get_background (&color);
           cairo_set_source_rgb (cr,
                                 color.r,


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