[gimp/gimp-2-10] libgimp, plug-ins: get rid of GIMP_EXPORT_NEEDS_OPAQUE_LAYERS capacity.



commit dc23facb1761cc2082f8be8c8377a575f61fab1b
Author: Jehan <jehan girinstud io>
Date:   Sat Jun 29 15:42:49 2019 +0200

    libgimp, plug-ins: get rid of GIMP_EXPORT_NEEDS_OPAQUE_LAYERS capacity.
    
    This new capacity was created just 3 commits ago (9933f46f85).
    The point was that the real fix is to remove the implication
    HANDLE_LAYERS => HANDLE_ALPHA, but this breaks public API behavior,
    which is why I didn't go with it.
    
    Still it just felt wrong to add a NEEP_OPAQUE capability when it should
    be the same thing as not setting HANDLE_ALPHA. After discussion on IRC,
    we decided that this implication was basically a bug, and since in all
    core plug-ins, when HANDLE_LAYERS was set, we were also setting
    HANDLE_ALPHA, no core plug-in code even has to be changed. As for
    third-party plug-ins, let's assume that none has been relying on this
    wrong assumption.
    
    (cherry picked from commit 667b4d71c942226c829a994b69d3311875c390c8)

 libgimp/gimpexport.c           | 4 ----
 libgimp/gimpexport.h           | 3 +--
 plug-ins/file-tiff/file-tiff.c | 6 ++++--
 3 files changed, 5 insertions(+), 8 deletions(-)
---
diff --git a/libgimp/gimpexport.c b/libgimp/gimpexport.c
index 9076db6ea5..f0f5c1df15 100644
--- a/libgimp/gimpexport.c
+++ b/libgimp/gimpexport.c
@@ -752,10 +752,6 @@ gimp_export_image (gint32                 *image_ID,
   if (capabilities & GIMP_EXPORT_CAN_HANDLE_LAYER_MASKS)
     capabilities |= GIMP_EXPORT_CAN_HANDLE_LAYERS;
 
-  if (capabilities & GIMP_EXPORT_CAN_HANDLE_LAYERS &&
-      ! (capabilities & GIMP_EXPORT_NEEDS_OPAQUE_LAYERS))
-    capabilities |= GIMP_EXPORT_CAN_HANDLE_ALPHA;
-
   if (format_name && g_getenv ("GIMP_INTERACTIVE_EXPORT"))
     interactive = TRUE;
 
diff --git a/libgimp/gimpexport.h b/libgimp/gimpexport.h
index 7e340b311c..11d4dff187 100644
--- a/libgimp/gimpexport.h
+++ b/libgimp/gimpexport.h
@@ -41,8 +41,7 @@ typedef enum
   GIMP_EXPORT_CAN_HANDLE_LAYERS              = 1 << 5,
   GIMP_EXPORT_CAN_HANDLE_LAYERS_AS_ANIMATION = 1 << 6,
   GIMP_EXPORT_CAN_HANDLE_LAYER_MASKS         = 1 << 7,
-  GIMP_EXPORT_NEEDS_ALPHA                    = 1 << 8,
-  GIMP_EXPORT_NEEDS_OPAQUE_LAYERS            = 1 << 9
+  GIMP_EXPORT_NEEDS_ALPHA                    = 1 << 8
 } GimpExportCapabilities;
 
 typedef enum
diff --git a/plug-ins/file-tiff/file-tiff.c b/plug-ins/file-tiff/file-tiff.c
index e1a80e8c5b..595792bb4c 100644
--- a/plug-ins/file-tiff/file-tiff.c
+++ b/plug-ins/file-tiff/file-tiff.c
@@ -381,8 +381,10 @@ run (const gchar      *name,
 
               if (tsvals.compression == COMPRESSION_CCITTFAX3 ||
                   tsvals.compression == COMPRESSION_CCITTFAX4)
-                capabilities = GIMP_EXPORT_CAN_HANDLE_INDEXED |
-                               GIMP_EXPORT_NEEDS_OPAQUE_LAYERS;
+                /* G3/G4 are fax compressions. They only support
+                 * monochrome images without alpha support.
+                 */
+                capabilities = GIMP_EXPORT_CAN_HANDLE_INDEXED;
               else
                 capabilities = GIMP_EXPORT_CAN_HANDLE_RGB     |
                                GIMP_EXPORT_CAN_HANDLE_GRAY    |


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