From 0bd94f172ae960c0229d925e08e489ec07cd8fa0 Mon Sep 17 00:00:00 2001 From: Jehan Date: Thu, 15 Jun 2017 20:53:55 +0200 Subject: [PATCH] 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 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plug-ins/common/file-pdf-save.c b/plug-ins/common/file-pdf-save.c index 0e8a940a1c..0476c1ee12 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++)