Commit 765975df authored by Jehan's avatar Jehan

plug-ins: gif export should not carry on when sanity_check() fails.

This specific crash was only occuring when GIMP_INTERACTIVE_EXPORT=1
and canceling the first dialog. So that should not happen too often,
but well, now it's fixed…
parent 09fed0a0
......@@ -287,39 +287,39 @@ run (const gchar *name,
}
}
/* Create an exportable image based on the export options */
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
{
GimpExportCapabilities capabilities =
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_ALPHA;
if (gsvals.as_animation)
capabilities |= GIMP_EXPORT_CAN_HANDLE_LAYERS;
export = gimp_export_image (&image_ID, &drawable_ID, "GIF",
capabilities);
if (export == GIMP_EXPORT_CANCEL)
{
values[0].data.d_status = GIMP_PDB_CANCEL;
if (sanitized_image_ID)
gimp_image_delete (sanitized_image_ID);
return;
}
}
break;
default:
break;
}
/* Write the image to file */
if (status == GIMP_PDB_SUCCESS)
{
/* Create an exportable image based on the export options */
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
{
GimpExportCapabilities capabilities =
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_ALPHA;
if (gsvals.as_animation)
capabilities |= GIMP_EXPORT_CAN_HANDLE_LAYERS;
export = gimp_export_image (&image_ID, &drawable_ID, "GIF",
capabilities);
if (export == GIMP_EXPORT_CANCEL)
{
values[0].data.d_status = GIMP_PDB_CANCEL;
if (sanitized_image_ID)
gimp_image_delete (sanitized_image_ID);
return;
}
}
break;
default:
break;
}
/* Write the image to file */
if (save_image (param[3].data.d_string,
image_ID, drawable_ID, orig_image_ID,
&error))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment