On Fri, 2009-03-06 at 14:17 +0100, peter sikking wrote:

> right. one thing I have no overview of is how many ‘topics’
> there are for which there are dialogs. Up to now I have seen
> layers, transparency, bit-depths.

Let's have a look at the capabilities that the save plug-ins announce:

typedef enum
  GIMP_EXPORT_CAN_HANDLE_RGB                 = 1 << 0,
  GIMP_EXPORT_CAN_HANDLE_GRAY                = 1 << 1,
  GIMP_EXPORT_CAN_HANDLE_INDEXED             = 1 << 2,
  GIMP_EXPORT_CAN_HANDLE_BITMAP              = 1 << 3,
  GIMP_EXPORT_CAN_HANDLE_ALPHA               = 1 << 4,
  GIMP_EXPORT_CAN_HANDLE_LAYERS              = 1 << 5,
  GIMP_EXPORT_NEEDS_ALPHA                    = 1 << 8
} GimpExportCapabilities;

This results in a variety of possible dialogs:

The image has more than one layer but the plug-in can't handle layers.
 -> "Flatten Image" or "Merge Visible Layers"
 (for plug-ins that need alpha channel, the "Flatten Image" option is
 (for plug-ins that can't handle an alpha channel, the "Merge" option
  is omitted)

The image has a single layer but that layer is of a different size than
the image, it is offset and/or it has an opacity != 100.
 -> "Merge Visible Layers"

The image has more than one layer and the plug-in can only handle this
if it treats those as frames of an animation.
 -> "Merge Visible Layers" or "Save as Animation"
 -> "Flatten Image" or "Save as Animation"
    (for plug-ins that don't support transparency)

The image has a layer with an alpha channel but the plug-in can't handle
 -> "Flatten Image"

The image has layer masks which the plug-in can't handle.
 -> "Apply Layer Masks"

The image has a layer without an alpha channel, but the plug-in relies
on one.
 -> "Add Alpha Channel"

And of course there are the various image mode conflicts that are
handled by offering to convert to the mode that the plug-in supports:

 "Convert to RGB"
 "Convert to Grayscale"
 "Convert to Indexed using default settings
  (Do it manually to tune the result)"
 "Convert to Indexed using bitmap default settings
  (Do it manually to tune the result)"

These can be combined as options if the destination format supports
several modes.

The gory details can be looked up in libgimp/gimpexport.c in the
function gimp_export_image().


Gimp-developer mailing list

Reply via email to