[gimp] plug-ins: properly "Apply layer masks before saving" when checked.



commit 0bd94f172ae960c0229d925e08e489ec07cd8fa0
Author: Jehan <jehan girinstud io>
Date:   Thu Jun 15 20:53:55 2017 +0200

    plug-ins: properly "Apply layer masks before saving" when checked.
    
    The `if` test was inverted. When the option is checked, we don't want to
    add the GIMP_EXPORT_CAN_HANDLE_LAYER_MASKS capability so that
    gimp_export_image() applies the mask.
    This is a first step to fix bug 783528, but it's not finished. Right
    now, when the option is unchecked, the mask is simply ignored. We want
    to export a PDF mask instead.

 plug-ins/common/file-pdf-save.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/plug-ins/common/file-pdf-save.c b/plug-ins/common/file-pdf-save.c
index 0e8a940..0476c1e 100644
--- a/plug-ins/common/file-pdf-save.c
+++ b/plug-ins/common/file-pdf-save.c
@@ -488,7 +488,10 @@ run (const gchar      *name,
                   GIMP_EXPORT_CAN_HANDLE_GRAY   |
                   GIMP_EXPORT_CAN_HANDLE_LAYERS |
                   GIMP_EXPORT_CAN_HANDLE_INDEXED);
-  if (optimize.apply_masks)
+  /* This seems counter-intuitive, but not setting the mask capability
+   * will apply any layer mask upon gimp_export_image().
+   */
+  if (! optimize.apply_masks)
     capabilities |= GIMP_EXPORT_CAN_HANDLE_LAYER_MASKS;
 
   for (i = 0; i < multi_page.image_count; i++)


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