libgimp, plug-ins: Run gimp_export_image ()...

...in non-interactive cases.
gimp_export_image () handles various
tasks like rasterizing NDE filters. It only
runs in interactive cases however, so if the
users calls gimp-file-save the filters are
not exported.
Since Jehan removed the hidden dialogue
in 0dc9ff7c, we can now safely call
gimp_export_image () in all cases to make
image export more consistent. This step is
also preparation for setting up the new
API with GimpExportOptions.
This commit is contained in:
Alx Sa 2024-07-14 20:12:57 +00:00
parent 3cab898d61
commit 899b45366e
40 changed files with 321 additions and 648 deletions

View File

@ -554,7 +554,6 @@ export_action_perform (const ExportAction *action,
/**
* gimp_export_image:
* @image: Pointer to the image.
* @format_name: The (short) name of the image_format (e.g. JPEG or GIF).
* @capabilities: What can the image_format do?
*
* Takes an image to be saved together with a description
@ -573,16 +572,11 @@ export_action_perform (const ExportAction *action,
* altered, GIMP_EXPORT_IGNORE is returned and the save_plugin
* should try to save the original image.
*
* If @format_name is NULL, no dialogs will be shown and this function
* will behave as if the user clicked on the 'Export' button, if a
* dialog would have been shown.
*
* Returns: An enum of #GimpExportReturn describing the user_action.
**/
GimpExportReturn
gimp_export_image (GimpImage **image,
const gchar *format_name,
GimpExportCapabilities capabilities)
gimp_export_image (GimpImage **image,
GimpExportCapabilities capabilities)
{
GSList *actions = NULL;
GimpImageBaseType type;

View File

@ -83,7 +83,6 @@ GtkWidget * gimp_export_dialog_new (const gchar *
GtkWidget * gimp_export_dialog_get_content_area (GtkWidget *dialog);
GimpExportReturn gimp_export_image (GimpImage **image,
const gchar *format_name,
GimpExportCapabilities capabilities);

View File

@ -176,30 +176,21 @@ ascii_export (GimpProcedure *procedure,
gegl_init (NULL, NULL);
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init (PLUG_IN_BINARY);
export = gimp_export_image (&image, "AA",
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
break;
default:
break;
}
drawables = gimp_image_list_layers (image);
if (run_mode == GIMP_RUN_INTERACTIVE)
{
gimp_ui_init (PLUG_IN_BINARY);
if (! save_dialog (procedure, G_OBJECT (config), image))
status = GIMP_PDB_CANCEL;
}
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
drawables = gimp_image_list_layers (image);
if (status == GIMP_PDB_SUCCESS)
{
if (! export_aa (file, drawables->data, G_OBJECT (config), &error))

View File

@ -287,21 +287,11 @@ cel_export (GimpProcedure *procedure,
gegl_init (NULL, NULL);
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init (PLUG_IN_BINARY);
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_ALPHA |
GIMP_EXPORT_CAN_HANDLE_INDEXED);
export = gimp_export_image (&image, "CEL",
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_ALPHA |
GIMP_EXPORT_CAN_HANDLE_INDEXED);
break;
default:
break;
}
drawables = gimp_image_list_layers (image);
if (! export_image (file, image, drawables->data, &error))

View File

@ -225,7 +225,7 @@ csource_export (GimpProcedure *procedure,
gimp_ui_init (PLUG_IN_BINARY);
export = gimp_export_image (&image, "C Source",
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
drawables = gimp_image_list_layers (image);

View File

@ -279,19 +279,10 @@ dicom_export (GimpProcedure *procedure,
gegl_init (NULL, NULL);
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init (PLUG_IN_BINARY);
export = gimp_export_image (&image, "DICOM",
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY);
break;
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY);
default:
break;
}
drawables = gimp_image_list_layers (image);
if (status == GIMP_PDB_SUCCESS)

View File

@ -226,22 +226,11 @@ farbfeld_export (GimpProcedure *procedure,
gegl_init (NULL, NULL);
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init (PLUG_IN_BINARY);
export = gimp_export_image (&image, "farbfeld",
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
break;
default:
break;
}
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
drawables = gimp_image_list_layers (image);
if (! export_image (file, image, drawables->data, &error))

View File

@ -199,31 +199,22 @@ gbr_export (GimpProcedure *procedure,
g_free (description);
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init (PLUG_IN_BINARY);
export = gimp_export_image (&image, "GBR",
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
break;
default:
break;
}
drawables = gimp_image_list_layers (image);
n_drawables = g_list_length (drawables);
if (run_mode == GIMP_RUN_INTERACTIVE)
{
gimp_ui_init (PLUG_IN_BINARY);
if (! save_dialog (procedure, G_OBJECT (config), image))
status = GIMP_PDB_CANCEL;
}
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
drawables = gimp_image_list_layers (image);
n_drawables = g_list_length (drawables);
if (status == GIMP_PDB_SUCCESS)
{
GimpProcedure *procedure;

View File

@ -286,22 +286,11 @@ goat_export (GimpProcedure *procedure,
gegl_init (NULL, NULL);
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init (PLUG_IN_BINARY);
export = gimp_export_image (&image, "GEGL",
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
break;
default:
break;
}
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
drawables = gimp_image_list_layers (image);
if (! export_image (file, format->export_op, image, drawables->data,

View File

@ -329,7 +329,12 @@ gif_export (GimpProcedure *procedure,
if (status == GIMP_PDB_SUCCESS)
{
GList *drawables;
GList *drawables;
GimpExportCapabilities capabilities;
capabilities = (GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
/* Create an exportable image based on the export options */
switch (run_mode)
@ -337,12 +342,7 @@ gif_export (GimpProcedure *procedure,
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
{
GimpExportCapabilities capabilities;
gboolean as_animation;
capabilities = (GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
gboolean as_animation;
g_object_get (config,
"as-animation", &as_animation,
@ -350,14 +350,13 @@ gif_export (GimpProcedure *procedure,
if (as_animation)
capabilities |= GIMP_EXPORT_CAN_HANDLE_LAYERS;
export = gimp_export_image (&image, "GIF", capabilities);
break;
}
default:
break;
}
export = gimp_export_image (&image, capabilities);
drawables = gimp_image_list_layers (image);
if (! export_image (file, image, drawables->data, orig_image,

View File

@ -279,12 +279,6 @@ gih_export (GimpProcedure *procedure,
gimp_pixpipe_params_init (&gihparams);
export = gimp_export_image (&image, "GIH",
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_ALPHA |
GIMP_EXPORT_CAN_HANDLE_LAYERS);
/* Possibly retrieve data */
parasite = gimp_image_get_parasite (orig_image,
"gimp-brush-pipe-name");
@ -384,6 +378,12 @@ gih_export (GimpProcedure *procedure,
goto out;
}
}
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_ALPHA |
GIMP_EXPORT_CAN_HANDLE_LAYERS);
layers = gimp_image_list_layers (image);
n_drawables = g_list_length (layers);

View File

@ -152,20 +152,9 @@ header_export (GimpProcedure *procedure,
gegl_init (NULL, NULL);
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init (PLUG_IN_BINARY);
export = gimp_export_image (&image, "Header",
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_INDEXED);
break;
default:
break;
}
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_INDEXED);
drawables = gimp_image_list_layers (image);
if (! export_image (file, image, drawables->data,

View File

@ -498,28 +498,19 @@ heif_export (GimpProcedure *procedure,
gegl_init (NULL, NULL);
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init (PLUG_IN_BINARY);
export = gimp_export_image (&image, "HEIF",
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
break;
default:
break;
}
drawables = gimp_image_list_layers (image);
if (run_mode == GIMP_RUN_INTERACTIVE)
{
gimp_ui_init (PLUG_IN_BINARY);
if (! save_dialog (procedure, G_OBJECT (config), image))
status = GIMP_PDB_CANCEL;
}
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
drawables = gimp_image_list_layers (image);
if (status == GIMP_PDB_SUCCESS)
{
GimpMetadataSaveFlags metadata_flags;
@ -570,28 +561,19 @@ heif_av1_export (GimpProcedure *procedure,
gegl_init (NULL, NULL);
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init (PLUG_IN_BINARY);
export = gimp_export_image (&image, "AVIF",
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
break;
default:
break;
}
drawables = gimp_image_list_layers (image);
if (run_mode == GIMP_RUN_INTERACTIVE)
{
gimp_ui_init (PLUG_IN_BINARY);
if (! save_dialog (procedure, G_OBJECT (config), image))
status = GIMP_PDB_CANCEL;
}
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
drawables = gimp_image_list_layers (image);
if (status == GIMP_PDB_SUCCESS)
{
GimpMetadataSaveFlags metadata_flags;

View File

@ -2126,31 +2126,22 @@ jpegxl_export (GimpProcedure *procedure,
gegl_init (NULL, NULL);
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init (PLUG_IN_BINARY);
export = gimp_export_image (&image, "JPEG XL",
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
break;
default:
break;
}
drawables = gimp_image_list_layers (image);
if (run_mode == GIMP_RUN_INTERACTIVE)
{
gimp_ui_init (PLUG_IN_BINARY);
if (! save_dialog (image, procedure, G_OBJECT (config)))
{
status = GIMP_PDB_CANCEL;
}
}
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
drawables = gimp_image_list_layers (image);
if (status == GIMP_PDB_SUCCESS)
{
GimpMetadataSaveFlags metadata_flags;

View File

@ -370,27 +370,23 @@ mng_export (GimpProcedure *procedure,
gegl_init (NULL, NULL);
if (run_mode == GIMP_RUN_INTERACTIVE ||
run_mode == GIMP_RUN_WITH_LAST_VALS)
if (run_mode == GIMP_RUN_INTERACTIVE)
{
gimp_ui_init (PLUG_IN_BINARY);
export = gimp_export_image (&image, "MNG",
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_ALPHA |
GIMP_EXPORT_CAN_HANDLE_LAYERS);
}
drawables = gimp_image_list_layers (image);
n_drawables = g_list_length (drawables);
if (run_mode == GIMP_RUN_INTERACTIVE)
{
if (! mng_save_dialog (image, procedure, G_OBJECT (config)))
status = GIMP_PDB_CANCEL;
}
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_ALPHA |
GIMP_EXPORT_CAN_HANDLE_LAYERS);
drawables = gimp_image_list_layers (image);
n_drawables = g_list_length (drawables);
if (status == GIMP_PDB_SUCCESS)
{
if (! mng_export_image (file, image, n_drawables, drawables,

View File

@ -178,31 +178,22 @@ pat_export (GimpProcedure *procedure,
g_free (description);
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init (PLUG_IN_BINARY);
export = gimp_export_image (&image, "PAT",
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
break;
default:
break;
}
drawables = gimp_image_list_layers (image);
n_drawables = g_list_length (drawables);
if (run_mode == GIMP_RUN_INTERACTIVE)
{
gimp_ui_init (PLUG_IN_BINARY);
if (! save_dialog (image, procedure, G_OBJECT (config)))
status = GIMP_PDB_CANCEL;
}
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
drawables = gimp_image_list_layers (image);
n_drawables = g_list_length (drawables);
if (status == GIMP_PDB_SUCCESS)
{
GimpProcedure *procedure;

View File

@ -375,21 +375,10 @@ pcx_export (GimpProcedure *procedure,
gegl_init (NULL, NULL);
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init (PLUG_IN_BINARY);
export = gimp_export_image (&image, "PCX",
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED);
break;
default:
break;
}
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED);
drawables = gimp_image_list_layers (image);
if (! export_image (file,

View File

@ -716,7 +716,7 @@ pdf_export_image (GimpProcedure *procedure,
*/
cairo_save (cr);
if (! (gimp_export_image (&image, NULL,
if (! (gimp_export_image (&image,
capabilities) == GIMP_EXPORT_EXPORT))
{
/* gimp_drawable_histogram() only works within the bounds of

View File

@ -267,21 +267,10 @@ pix_export (GimpProcedure *procedure,
gegl_init (NULL, NULL);
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init (PLUG_IN_BINARY);
export = gimp_export_image (&image, "PIX",
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED);
break;
default:
break;
}
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED);
drawables = gimp_image_list_layers (image);
if (! export_image (file, image, drawables->data, &error))

View File

@ -382,22 +382,11 @@ png_export (GimpProcedure *procedure,
orig_image = image;
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init (PLUG_IN_BINARY);
export = gimp_export_image (&image, "PNG",
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
break;
default:
break;
}
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
drawables = gimp_image_list_layers (image);
alpha = gimp_drawable_has_alpha (drawables->data);
@ -412,6 +401,8 @@ png_export (GimpProcedure *procedure,
if (run_mode == GIMP_RUN_INTERACTIVE)
{
gimp_ui_init (PLUG_IN_BINARY);
if (! export_dialog (orig_image, procedure, G_OBJECT (config), alpha))
status = GIMP_PDB_CANCEL;
}

View File

@ -603,66 +603,57 @@ pnm_export (GimpProcedure *procedure,
gegl_init (NULL, NULL);
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init (PLUG_IN_BINARY);
switch (file_type)
{
case FILE_TYPE_PNM:
export = gimp_export_image (&image, "PNM",
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED);
break;
case FILE_TYPE_PBM:
export = gimp_export_image (&image, "PBM",
GIMP_EXPORT_CAN_HANDLE_BITMAP);
break;
case FILE_TYPE_PGM:
export = gimp_export_image (&image, "PGM",
GIMP_EXPORT_CAN_HANDLE_GRAY);
break;
case FILE_TYPE_PPM:
export = gimp_export_image (&image, "PPM",
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_INDEXED);
break;
case FILE_TYPE_PAM:
export = gimp_export_image (&image, "PAM",
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_ALPHA |
GIMP_EXPORT_CAN_HANDLE_INDEXED);
break;
case FILE_TYPE_PFM:
export = gimp_export_image (&image, "PFM",
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY);
break;
}
break;
default:
break;
}
drawables = gimp_image_list_layers (image);
if (file_type != FILE_TYPE_PFM &&
file_type != FILE_TYPE_PAM &&
run_mode == GIMP_RUN_INTERACTIVE)
{
gimp_ui_init (PLUG_IN_BINARY);
if (! save_dialog (procedure, G_OBJECT (config), image))
status = GIMP_PDB_CANCEL;
}
switch (file_type)
{
case FILE_TYPE_PNM:
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED);
break;
case FILE_TYPE_PBM:
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_BITMAP);
break;
case FILE_TYPE_PGM:
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_GRAY);
break;
case FILE_TYPE_PPM:
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_INDEXED);
break;
case FILE_TYPE_PAM:
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_ALPHA |
GIMP_EXPORT_CAN_HANDLE_INDEXED);
break;
case FILE_TYPE_PFM:
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY);
break;
}
drawables = gimp_image_list_layers (image);
if (status == GIMP_PDB_SUCCESS)
{
if (! export_image (file, image, drawables->data, file_type,

View File

@ -757,24 +757,7 @@ ps_export (GimpProcedure *procedure,
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init (PLUG_IN_BINARY);
export = gimp_export_image (&image,
eps_flag ? "EPS" : "PostScript",
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED);
break;
default:
break;
}
drawables = gimp_image_list_layers (image);
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
ps_set_save_size (G_OBJECT (config), orig_image);
if (! save_dialog (procedure, G_OBJECT (config), image))
@ -789,6 +772,12 @@ ps_export (GimpProcedure *procedure,
break;
}
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED);
drawables = gimp_image_list_layers (image);
if (status == GIMP_PDB_SUCCESS)
{
gdouble width = 0.0;

View File

@ -775,32 +775,23 @@ psp_export (GimpProcedure *procedure,
gegl_init (NULL, NULL);
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init (PLUG_IN_BINARY);
export = gimp_export_image (&image, "PSP",
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_ALPHA |
GIMP_EXPORT_CAN_HANDLE_LAYERS);
break;
default:
break;
}
drawables = gimp_image_list_layers (image);
n_drawables = g_list_length (drawables);
if (run_mode == GIMP_RUN_INTERACTIVE)
{
gimp_ui_init (PLUG_IN_BINARY);
if (! save_dialog (procedure, G_OBJECT (config), image))
status = GIMP_PDB_CANCEL;
}
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_ALPHA |
GIMP_EXPORT_CAN_HANDLE_LAYERS);
drawables = gimp_image_list_layers (image);
n_drawables = g_list_length (drawables);
if (status == GIMP_PDB_SUCCESS)
{
if (! export_image (file, image, n_drawables, drawables,

View File

@ -230,22 +230,11 @@ qoi_export (GimpProcedure *procedure,
gegl_init (NULL, NULL);
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init (PLUG_IN_BINARY);
export = gimp_export_image (&image, "qoi",
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
break;
default:
break;
}
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
drawables = gimp_image_list_layers (image);
if (! export_image (file, image, drawables->data, &error))

View File

@ -677,7 +677,7 @@ raw_export (GimpProcedure *procedure,
NULL);
}
export = gimp_export_image (&image, "RAW",
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED |

View File

@ -376,29 +376,20 @@ sunras_export (GimpProcedure *procedure,
gegl_init (NULL, NULL);
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init (PLUG_IN_BINARY);
export = gimp_export_image (&image, "SUNRAS",
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED);
break;
default:
break;
}
drawables = gimp_image_list_layers (image);
if (run_mode == GIMP_RUN_INTERACTIVE)
{
gimp_ui_init (PLUG_IN_BINARY);
if (! save_dialog (image, procedure, G_OBJECT (config)))
status = GIMP_PDB_CANCEL;
}
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED);
drawables = gimp_image_list_layers (image);
if (status == GIMP_PDB_SUCCESS)
{
if (! export_image (file, image, drawables->data, G_OBJECT (config),

View File

@ -365,30 +365,21 @@ tga_export (GimpProcedure *procedure,
gegl_init (NULL, NULL);
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init (PLUG_IN_BINARY);
export = gimp_export_image (&image, "TGA",
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
break;
default:
break;
}
drawables = gimp_image_list_layers (image);
if (run_mode == GIMP_RUN_INTERACTIVE)
{
gimp_ui_init (PLUG_IN_BINARY);
if (! save_dialog (image, procedure, G_OBJECT (config)))
status = GIMP_PDB_CANCEL;
}
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
drawables = gimp_image_list_layers (image);
if (status == GIMP_PDB_SUCCESS)
{
if (! export_image (file, image, drawables->data, G_OBJECT (config),

View File

@ -349,22 +349,6 @@ xbm_export (GimpProcedure *procedure,
gegl_init (NULL, NULL);
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init (PLUG_IN_BINARY);
export = gimp_export_image (&image, "XBM",
GIMP_EXPORT_CAN_HANDLE_BITMAP |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
break;
default:
break;
}
drawables = gimp_image_list_layers (image);
if (run_mode == GIMP_RUN_INTERACTIVE ||
run_mode == GIMP_RUN_WITH_LAST_VALS)
{
@ -372,10 +356,16 @@ xbm_export (GimpProcedure *procedure,
mask_basename = g_strdup (init_prefix (file, G_OBJECT (config)));
}
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_BITMAP |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
drawables = gimp_image_list_layers (image);
if (run_mode == GIMP_RUN_INTERACTIVE)
{
GimpParasite *parasite;
gimp_ui_init (PLUG_IN_BINARY);
parasite = gimp_image_get_parasite (image, "hot-spot");
if (parasite)

View File

@ -531,8 +531,8 @@ xmc_export (GimpProcedure *procedure,
{
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
GimpExportReturn export = GIMP_EXPORT_IGNORE;
GList *drawables = gimp_image_list_layers (image);
gint n_drawables = g_list_length (drawables);
GList *drawables = NULL;
gint n_drawables = NULL;
GimpImage *orig_image;
GeglRectangle *hotspot_range;
gint hot_spot_x;
@ -560,25 +560,7 @@ xmc_export (GimpProcedure *procedure,
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init (PLUG_IN_BINARY);
export = gimp_export_image (&image, "XMC",
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_ALPHA |
GIMP_EXPORT_CAN_HANDLE_LAYERS |
GIMP_EXPORT_NEEDS_ALPHA);
break;
default:
break;
}
drawables = gimp_image_list_layers (image);
n_drawables = g_list_length (drawables);
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
load_default_hotspot (image, hotspot_range, G_OBJECT (config));
if (! save_dialog (procedure, G_OBJECT (config), image, hotspot_range))
@ -610,6 +592,14 @@ xmc_export (GimpProcedure *procedure,
break;
}
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_ALPHA |
GIMP_EXPORT_CAN_HANDLE_LAYERS |
GIMP_EXPORT_NEEDS_ALPHA);
drawables = gimp_image_list_layers (image);
n_drawables = g_list_length (drawables);
if (! export_image (file, image, n_drawables, drawables,
orig_image, G_OBJECT (config), &error))
{

View File

@ -313,26 +313,17 @@ xpm_export (GimpProcedure *procedure,
gegl_init (NULL, NULL);
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init (PLUG_IN_BINARY);
export = gimp_export_image (&image, "XPM",
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
break;
default:
break;
}
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
drawables = gimp_image_list_layers (image);
if (run_mode == GIMP_RUN_INTERACTIVE)
{
gimp_ui_init (PLUG_IN_BINARY);
if (gimp_drawable_has_alpha (drawables->data))
if (! save_dialog (image, procedure, G_OBJECT (config)))
status = GIMP_PDB_CANCEL;

View File

@ -423,27 +423,14 @@ xwd_export (GimpProcedure *procedure,
gegl_init (NULL, NULL);
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init (PLUG_IN_BINARY);
export = gimp_export_image (&image, "XWD",
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED);
break;
default:
break;
}
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED);
drawables = gimp_image_list_layers (image);
if (! export_image (file, image, drawables->data, &error))
{
status = GIMP_PDB_EXECUTION_ERROR;
}
status = GIMP_PDB_EXECUTION_ERROR;
if (export == GIMP_EXPORT_EXPORT)
gimp_image_delete (image);

View File

@ -267,22 +267,14 @@ bmp_export (GimpProcedure *procedure,
gegl_init (NULL, NULL);
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init (PLUG_IN_BINARY);
if (run_mode == GIMP_RUN_INTERACTIVE)
gimp_ui_init (PLUG_IN_BINARY);
export = gimp_export_image (&image, "BMP",
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_ALPHA |
GIMP_EXPORT_CAN_HANDLE_INDEXED);
break;
default:
break;
}
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_ALPHA |
GIMP_EXPORT_CAN_HANDLE_INDEXED);
drawables = gimp_image_list_layers (image);
status = export_image (file, image, drawables->data, run_mode,

View File

@ -382,23 +382,15 @@ dds_export (GimpProcedure *procedure,
gegl_init (NULL, NULL);
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init ("dds");
if (run_mode == GIMP_RUN_INTERACTIVE)
gimp_ui_init ("dds");
export = gimp_export_image (&image, "DDS",
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_ALPHA |
GIMP_EXPORT_CAN_HANDLE_LAYERS);
break;
default:
break;
}
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_ALPHA |
GIMP_EXPORT_CAN_HANDLE_LAYERS);
drawables = gimp_image_list_layers (image);
g_object_get (config,

View File

@ -302,21 +302,14 @@ fits_export (GimpProcedure *procedure,
gegl_init (NULL, NULL);
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init (PLUG_IN_BINARY);
if (run_mode == GIMP_RUN_INTERACTIVE)
gimp_ui_init (PLUG_IN_BINARY);
export = gimp_export_image (&image, "FITS",
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED);
break;
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED);
default:
break;
}
drawables = gimp_image_list_layers (image);
n_drawables = g_list_length (drawables);

View File

@ -345,30 +345,21 @@ fli_export (GimpProcedure *procedure,
gegl_init (NULL, NULL);
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init (PLUG_IN_BINARY);
export = gimp_export_image (&image, "FLI",
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_ALPHA |
GIMP_EXPORT_CAN_HANDLE_LAYERS);
break;
default:
break;
}
drawables = gimp_image_list_layers (image);
if (run_mode == GIMP_RUN_INTERACTIVE)
{
gimp_ui_init (PLUG_IN_BINARY);
if (! save_dialog (image, procedure, G_OBJECT (config)))
status = GIMP_PDB_CANCEL;
}
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_ALPHA |
GIMP_EXPORT_CAN_HANDLE_LAYERS);
drawables = gimp_image_list_layers (image);
if (status == GIMP_PDB_SUCCESS)
{
if (! export_image (file, image, G_OBJECT (config),

View File

@ -436,33 +436,6 @@ jpeg_export (GimpProcedure *procedure,
orig_image = image;
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init (PLUG_IN_BINARY);
export = gimp_export_image (&image, "JPEG",
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY);
switch (export)
{
case GIMP_EXPORT_EXPORT:
display = NULL;
separate_display = TRUE;
break;
case GIMP_EXPORT_IGNORE:
break;
}
break;
default:
break;
}
drawables = gimp_image_list_layers (image);
/* Override preferences from JPG export defaults (if saved). */
switch (run_mode)
@ -545,10 +518,17 @@ jpeg_export (GimpProcedure *procedure,
"original-num-quant-tables", orig_num_quant_tables,
NULL);
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY);
drawables = gimp_image_list_layers (image);
if (run_mode == GIMP_RUN_INTERACTIVE)
{
gboolean show_preview = FALSE;
gimp_ui_init (PLUG_IN_BINARY);
g_object_get (config, "show-preview", &show_preview, NULL);
if (show_preview)
{
@ -563,6 +543,8 @@ jpeg_export (GimpProcedure *procedure,
preview_image = image;
orig_image_global = orig_image;
drawable_global = drawables->data;
display = NULL;
separate_display = TRUE;
/* First acquire information with a dialog */
if (! save_dialog (procedure, config, drawables->data, orig_image))

View File

@ -432,33 +432,24 @@ psd_export (GimpProcedure *procedure,
gegl_init (NULL, NULL);
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init (PLUG_IN_BINARY);
export = gimp_export_image (&image, "PSD",
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_ALPHA |
GIMP_EXPORT_CAN_HANDLE_LAYERS |
GIMP_EXPORT_CAN_HANDLE_LAYER_MASKS);
break;
default:
break;
}
drawables = gimp_image_list_layers (image);
if (run_mode == GIMP_RUN_INTERACTIVE)
{
gimp_ui_init (PLUG_IN_BINARY);
if (! save_dialog (image, procedure, G_OBJECT (config)))
return gimp_procedure_new_return_values (procedure, GIMP_PDB_CANCEL,
NULL);
}
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_ALPHA |
GIMP_EXPORT_CAN_HANDLE_LAYERS |
GIMP_EXPORT_CAN_HANDLE_LAYER_MASKS);
drawables = gimp_image_list_layers (image);
if (export_image (file, image, G_OBJECT (config), &error))
{
if (metadata)

View File

@ -245,30 +245,21 @@ sgi_export (GimpProcedure *procedure,
gegl_init (NULL, NULL);
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init (PLUG_IN_BINARY);
export = gimp_export_image (&image, "SGI",
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
break;
default:
break;
}
drawables = gimp_image_list_layers (image);
if (run_mode == GIMP_RUN_INTERACTIVE)
{
gimp_ui_init (PLUG_IN_BINARY);
if (! save_dialog (procedure, G_OBJECT (config), image))
status = GIMP_PDB_CANCEL;
}
export = gimp_export_image (&image,
GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
drawables = gimp_image_list_layers (image);
if (status == GIMP_PDB_SUCCESS)
{
if (! export_image (file, image, drawables->data,

View File

@ -394,53 +394,45 @@ tiff_export_rec (GimpProcedure *procedure,
}
}
switch (run_mode)
if (status == GIMP_PDB_SUCCESS)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
{
GimpExportCapabilities capabilities;
GimpCompression compression;
gboolean save_layers;
gboolean crop_layers;
GimpExportCapabilities capabilities;
GimpCompression compression;
gboolean save_layers;
gboolean crop_layers;
g_object_get (config,
"bigtiff", &bigtiff,
"save-layers", &save_layers,
"crop-layers", &crop_layers,
NULL);
compression = gimp_procedure_config_get_choice_id (config, "compression");
g_object_get (config,
"bigtiff", &bigtiff,
"save-layers", &save_layers,
"crop-layers", &crop_layers,
NULL);
compression = gimp_procedure_config_get_choice_id (config, "compression");
if (compression == GIMP_COMPRESSION_CCITTFAX3 ||
compression == GIMP_COMPRESSION_CCITTFAX4)
{
/* 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 |
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
}
if (compression == GIMP_COMPRESSION_CCITTFAX3 ||
compression == GIMP_COMPRESSION_CCITTFAX4)
{
/* 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 |
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_ALPHA);
}
if (save_layers && image_is_multi_layer (orig_image))
{
capabilities |= GIMP_EXPORT_CAN_HANDLE_LAYERS;
if (save_layers && image_is_multi_layer (orig_image))
{
capabilities |= GIMP_EXPORT_CAN_HANDLE_LAYERS;
if (crop_layers)
capabilities |= GIMP_EXPORT_NEEDS_CROP;
}
if (crop_layers)
capabilities |= GIMP_EXPORT_NEEDS_CROP;
}
export = gimp_export_image (&image, "TIFF", capabilities);
}
break;
default:
break;
export = gimp_export_image (&image, capabilities);
}
drawables = gimp_image_list_layers (image);

View File

@ -295,8 +295,7 @@ webp_export (GimpProcedure *procedure,
gegl_init (NULL, NULL);
if (run_mode == GIMP_RUN_INTERACTIVE ||
run_mode == GIMP_RUN_WITH_LAST_VALS)
if (run_mode == GIMP_RUN_INTERACTIVE)
gimp_ui_init (PLUG_IN_BINARY);
if (run_mode == GIMP_RUN_INTERACTIVE)
@ -311,8 +310,7 @@ webp_export (GimpProcedure *procedure,
"animation", &animation,
NULL);
if (run_mode == GIMP_RUN_INTERACTIVE ||
run_mode == GIMP_RUN_WITH_LAST_VALS)
if (status == GIMP_PDB_SUCCESS)
{
GimpExportCapabilities capabilities = (GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
@ -322,7 +320,7 @@ webp_export (GimpProcedure *procedure,
if (animation)
capabilities |= GIMP_EXPORT_CAN_HANDLE_LAYERS_AS_ANIMATION;
export = gimp_export_image (&image, "WebP", capabilities);
export = gimp_export_image (&image, capabilities);
}
drawables = gimp_image_list_layers (image);
n_drawables = g_list_length (drawables);