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.
This commit is contained in:
Jehan 2019-06-29 15:42:49 +02:00
parent e72a9d88a5
commit 667b4d71c9
3 changed files with 5 additions and 8 deletions

View File

@ -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;

View File

@ -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

View File

@ -383,8 +383,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 |