mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-03 17:33:25 +00:00
plug-ins: Fix crash when exporting indexed HTML tables
Resolves #13122 The HTML table code expects RGB or Grayscale pixels when creating a "BGCOLOR" attribute in the table. This patch defines the capabilities of the exporter in GimpExportOptions and retrieves a suitable image with gimp_export_options_get_image ().
This commit is contained in:
parent
4cd3360d53
commit
133bd2d432
1 changed files with 15 additions and 4 deletions
|
@ -170,6 +170,11 @@ html_create_procedure (GimpPlugIn *plug_in,
|
||||||
"text/html");
|
"text/html");
|
||||||
gimp_file_procedure_set_extensions (GIMP_FILE_PROCEDURE (procedure),
|
gimp_file_procedure_set_extensions (GIMP_FILE_PROCEDURE (procedure),
|
||||||
"html,htm");
|
"html,htm");
|
||||||
|
gimp_export_procedure_set_capabilities (GIMP_EXPORT_PROCEDURE (procedure),
|
||||||
|
GIMP_EXPORT_CAN_HANDLE_RGB |
|
||||||
|
GIMP_EXPORT_CAN_HANDLE_GRAY |
|
||||||
|
GIMP_EXPORT_CAN_HANDLE_ALPHA,
|
||||||
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
gimp_procedure_add_boolean_aux_argument (procedure, "use-caption",
|
gimp_procedure_add_boolean_aux_argument (procedure, "use-caption",
|
||||||
_("Use c_aption"),
|
_("Use c_aption"),
|
||||||
|
@ -264,7 +269,8 @@ html_export (GimpProcedure *procedure,
|
||||||
gpointer run_data)
|
gpointer run_data)
|
||||||
{
|
{
|
||||||
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
|
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
|
||||||
GList *drawables = gimp_image_list_layers (image);
|
GimpExportReturn export = GIMP_EXPORT_IGNORE;
|
||||||
|
GList *drawables;
|
||||||
GeglBuffer *buffer;
|
GeglBuffer *buffer;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
|
@ -280,6 +286,8 @@ html_export (GimpProcedure *procedure,
|
||||||
GIMP_PDB_CANCEL,
|
GIMP_PDB_CANCEL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
export = gimp_export_options_get_image (options, &image);
|
||||||
|
drawables = gimp_image_list_layers (image);
|
||||||
buffer = gimp_drawable_get_buffer (drawables->data);
|
buffer = gimp_drawable_get_buffer (drawables->data);
|
||||||
|
|
||||||
if (! export_image (file, buffer, G_OBJECT (config),
|
if (! export_image (file, buffer, G_OBJECT (config),
|
||||||
|
@ -288,6 +296,9 @@ html_export (GimpProcedure *procedure,
|
||||||
status = GIMP_PDB_EXECUTION_ERROR;
|
status = GIMP_PDB_EXECUTION_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (export == GIMP_EXPORT_EXPORT)
|
||||||
|
gimp_image_delete (image);
|
||||||
|
|
||||||
g_object_unref (buffer);
|
g_object_unref (buffer);
|
||||||
|
|
||||||
g_list_free (drawables);
|
g_list_free (drawables);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue