mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-04 09:53:25 +00:00
plug-ins: Use GimpExportOptions for ICO export
Since the ICO plug-in did not process the image with gimp_export_options_get_image () before export, filters were not being merged down and thus not included in the final image. This patch adds that feature to ICO, CUR, and ANI exports.
This commit is contained in:
parent
d17684734f
commit
6f50061eff
1 changed files with 40 additions and 1 deletions
|
@ -310,6 +310,14 @@ ico_create_procedure (GimpPlugIn *plug_in,
|
||||||
"image/x-ico");
|
"image/x-ico");
|
||||||
gimp_file_procedure_set_extensions (GIMP_FILE_PROCEDURE (procedure),
|
gimp_file_procedure_set_extensions (GIMP_FILE_PROCEDURE (procedure),
|
||||||
"ico");
|
"ico");
|
||||||
|
|
||||||
|
gimp_export_procedure_set_capabilities (GIMP_EXPORT_PROCEDURE (procedure),
|
||||||
|
GIMP_EXPORT_CAN_HANDLE_RGB |
|
||||||
|
GIMP_EXPORT_CAN_HANDLE_GRAY |
|
||||||
|
GIMP_EXPORT_CAN_HANDLE_ALPHA |
|
||||||
|
GIMP_EXPORT_CAN_HANDLE_INDEXED |
|
||||||
|
GIMP_EXPORT_CAN_HANDLE_LAYERS,
|
||||||
|
NULL, NULL, NULL);
|
||||||
}
|
}
|
||||||
else if (! strcmp (name, EXPORT_CUR_PROC))
|
else if (! strcmp (name, EXPORT_CUR_PROC))
|
||||||
{
|
{
|
||||||
|
@ -340,6 +348,14 @@ ico_create_procedure (GimpPlugIn *plug_in,
|
||||||
gimp_file_procedure_set_extensions (GIMP_FILE_PROCEDURE (procedure),
|
gimp_file_procedure_set_extensions (GIMP_FILE_PROCEDURE (procedure),
|
||||||
"cur");
|
"cur");
|
||||||
|
|
||||||
|
gimp_export_procedure_set_capabilities (GIMP_EXPORT_PROCEDURE (procedure),
|
||||||
|
GIMP_EXPORT_CAN_HANDLE_RGB |
|
||||||
|
GIMP_EXPORT_CAN_HANDLE_GRAY |
|
||||||
|
GIMP_EXPORT_CAN_HANDLE_ALPHA |
|
||||||
|
GIMP_EXPORT_CAN_HANDLE_INDEXED |
|
||||||
|
GIMP_EXPORT_CAN_HANDLE_LAYERS,
|
||||||
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
gimp_procedure_add_int32_array_argument (procedure, "hot-spot-x",
|
gimp_procedure_add_int32_array_argument (procedure, "hot-spot-x",
|
||||||
"Hot spot X",
|
"Hot spot X",
|
||||||
"X coordinates of hot spot (one per layer)",
|
"X coordinates of hot spot (one per layer)",
|
||||||
|
@ -378,6 +394,14 @@ ico_create_procedure (GimpPlugIn *plug_in,
|
||||||
gimp_file_procedure_set_extensions (GIMP_FILE_PROCEDURE (procedure),
|
gimp_file_procedure_set_extensions (GIMP_FILE_PROCEDURE (procedure),
|
||||||
"ani");
|
"ani");
|
||||||
|
|
||||||
|
gimp_export_procedure_set_capabilities (GIMP_EXPORT_PROCEDURE (procedure),
|
||||||
|
GIMP_EXPORT_CAN_HANDLE_RGB |
|
||||||
|
GIMP_EXPORT_CAN_HANDLE_GRAY |
|
||||||
|
GIMP_EXPORT_CAN_HANDLE_ALPHA |
|
||||||
|
GIMP_EXPORT_CAN_HANDLE_INDEXED |
|
||||||
|
GIMP_EXPORT_CAN_HANDLE_LAYERS,
|
||||||
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
gimp_procedure_add_string_argument (procedure, "cursor-name",
|
gimp_procedure_add_string_argument (procedure, "cursor-name",
|
||||||
"Cursor Name",
|
"Cursor Name",
|
||||||
_("Cursor Name (Optional)"),
|
_("Cursor Name (Optional)"),
|
||||||
|
@ -562,12 +586,17 @@ ico_export (GimpProcedure *procedure,
|
||||||
gpointer run_data)
|
gpointer run_data)
|
||||||
{
|
{
|
||||||
GimpPDBStatusType status;
|
GimpPDBStatusType status;
|
||||||
|
GimpExportReturn export = GIMP_EXPORT_IGNORE;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
gegl_init (NULL, NULL);
|
gegl_init (NULL, NULL);
|
||||||
|
|
||||||
|
export = gimp_export_options_get_image (options, &image);
|
||||||
status = ico_export_image (file, image, procedure, config, run_mode, &error);
|
status = ico_export_image (file, image, procedure, config, run_mode, &error);
|
||||||
|
|
||||||
|
if (export == GIMP_EXPORT_EXPORT)
|
||||||
|
gimp_image_delete (image);
|
||||||
|
|
||||||
return gimp_procedure_new_return_values (procedure, status, error);
|
return gimp_procedure_new_return_values (procedure, status, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -582,6 +611,7 @@ cur_export (GimpProcedure *procedure,
|
||||||
gpointer run_data)
|
gpointer run_data)
|
||||||
{
|
{
|
||||||
GimpPDBStatusType status;
|
GimpPDBStatusType status;
|
||||||
|
GimpExportReturn export = GIMP_EXPORT_IGNORE;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
GimpArray *x_array = NULL;
|
GimpArray *x_array = NULL;
|
||||||
GimpArray *y_array = NULL;
|
GimpArray *y_array = NULL;
|
||||||
|
@ -602,6 +632,7 @@ cur_export (GimpProcedure *procedure,
|
||||||
hot_spot_x = gimp_int32_array_get_values (x_array, &n_hot_spot_x);
|
hot_spot_x = gimp_int32_array_get_values (x_array, &n_hot_spot_x);
|
||||||
hot_spot_y = gimp_int32_array_get_values (y_array, &n_hot_spot_y);
|
hot_spot_y = gimp_int32_array_get_values (y_array, &n_hot_spot_y);
|
||||||
|
|
||||||
|
export = gimp_export_options_get_image (options, &image);
|
||||||
status = cur_export_image (file, image, procedure, config, run_mode,
|
status = cur_export_image (file, image, procedure, config, run_mode,
|
||||||
&n_hot_spot_x, hot_spot_x, &new_hot_spot_x,
|
&n_hot_spot_x, hot_spot_x, &new_hot_spot_x,
|
||||||
&n_hot_spot_y, hot_spot_y, &new_hot_spot_y,
|
&n_hot_spot_y, hot_spot_y, &new_hot_spot_y,
|
||||||
|
@ -619,6 +650,9 @@ cur_export (GimpProcedure *procedure,
|
||||||
g_free (new_hot_spot_y);
|
g_free (new_hot_spot_y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (export == GIMP_EXPORT_EXPORT)
|
||||||
|
gimp_image_delete (image);
|
||||||
|
|
||||||
return gimp_procedure_new_return_values (procedure, status, error);
|
return gimp_procedure_new_return_values (procedure, status, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -633,6 +667,7 @@ ani_export (GimpProcedure *procedure,
|
||||||
gpointer run_data)
|
gpointer run_data)
|
||||||
{
|
{
|
||||||
GimpPDBStatusType status;
|
GimpPDBStatusType status;
|
||||||
|
GimpExportReturn export = GIMP_EXPORT_IGNORE;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
gchar *inam = NULL;
|
gchar *inam = NULL;
|
||||||
gchar *iart = NULL;
|
gchar *iart = NULL;
|
||||||
|
@ -666,6 +701,7 @@ ani_export (GimpProcedure *procedure,
|
||||||
hot_spot_x = gimp_int32_array_get_values (x_array, &n_hot_spot_x);
|
hot_spot_x = gimp_int32_array_get_values (x_array, &n_hot_spot_x);
|
||||||
hot_spot_y = gimp_int32_array_get_values (y_array, &n_hot_spot_y);
|
hot_spot_y = gimp_int32_array_get_values (y_array, &n_hot_spot_y);
|
||||||
|
|
||||||
|
export = gimp_export_options_get_image (options, &image);
|
||||||
status = ani_export_image (file, image, procedure, config, run_mode,
|
status = ani_export_image (file, image, procedure, config, run_mode,
|
||||||
&n_hot_spot_x, hot_spot_x, &new_hot_spot_x,
|
&n_hot_spot_x, hot_spot_x, &new_hot_spot_x,
|
||||||
&n_hot_spot_y, hot_spot_y, &new_hot_spot_y,
|
&n_hot_spot_y, hot_spot_y, &new_hot_spot_y,
|
||||||
|
@ -692,6 +728,9 @@ ani_export (GimpProcedure *procedure,
|
||||||
memset (&ani_info, 0, sizeof (AniSaveInfo));
|
memset (&ani_info, 0, sizeof (AniSaveInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (export == GIMP_EXPORT_EXPORT)
|
||||||
|
gimp_image_delete (image);
|
||||||
|
|
||||||
return gimp_procedure_new_return_values (procedure, status, error);
|
return gimp_procedure_new_return_values (procedure, status, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue