From 19c2344a8d24c67f37c5ab48d473bdbd7d40b5ca Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Wed, 26 Mar 2008 13:12:02 +0000 Subject: [PATCH] plug-ins/common/gif-save.c improved error messages. 2008-03-26 Sven Neumann * plug-ins/common/gif-save.c * plug-ins/common/psd-save.c (save_image): improved error messages. svn path=/trunk/; revision=25238 --- ChangeLog | 5 +++++ plug-ins/common/gif-save.c | 22 ++++++++++++++-------- plug-ins/common/psd-save.c | 6 +++--- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3799ac1ae7..9c59d38a02 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-03-26 Sven Neumann + + * plug-ins/common/gif-save.c + * plug-ins/common/psd-save.c (save_image): improved error messages. + 2008-03-26 Michael Natterer * app/display/gimpcanvas.c (gimp_canvas_draw_drop_zone): add diff --git a/plug-ins/common/gif-save.c b/plug-ins/common/gif-save.c index 31b029d4f4..c797d68aaa 100644 --- a/plug-ins/common/gif-save.c +++ b/plug-ins/common/gif-save.c @@ -93,7 +93,8 @@ static gint save_image (const gchar *filename, gint32 drawable_ID, gint32 orig_image_ID); -static gboolean sanity_check (gint32 image_ID); +static gboolean sanity_check (const gchar *filename, + gint32 image_ID); static gboolean bad_bounds_dialog (void); static gboolean save_dialog (gint32 image_ID); @@ -180,9 +181,6 @@ run (const gchar *name, { static GimpParam values[2]; GimpPDBStatusType status = GIMP_PDB_SUCCESS; - gint32 image_ID; - gint32 drawable_ID; - gint32 orig_image_ID; GimpExportReturn export = GIMP_EXPORT_CANCEL; run_mode = param[0].data.d_int32; @@ -191,13 +189,20 @@ run (const gchar *name, *nreturn_vals = 1; *return_vals = values; + values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; if (strcmp (name, SAVE_PROC) == 0) { + const gchar *filename; + gint32 image_ID; + gint32 drawable_ID; + gint32 orig_image_ID; + image_ID = orig_image_ID = param[1].data.d_int32; drawable_ID = param[2].data.d_int32; + filename = param[3].data.d_string; /* eventually export the image */ switch (run_mode) @@ -220,7 +225,7 @@ run (const gchar *name, break; } - if (sanity_check (image_ID)) + if (sanity_check (filename, image_ID)) { switch (run_mode) { @@ -531,7 +536,8 @@ parse_disposal_tag (const gchar *str) static gboolean -sanity_check (gint32 image_ID) +sanity_check (const gchar *filename, + gint32 image_ID) { gint32 *layers; gint nlayers; @@ -544,8 +550,8 @@ sanity_check (gint32 image_ID) if (image_width > G_MAXUSHORT || image_height > G_MAXUSHORT) { - g_message (_("The GIF format does not support images larger " - "than %d x %d pixels."), G_MAXUSHORT, G_MAXUSHORT); + g_message (_("Unable to save '%s'. The GIF file format does not support images that are more than %d pixels wide or tall."), + gimp_filename_to_utf8 (filename), G_MAXUSHORT); return FALSE; } diff --git a/plug-ins/common/psd-save.c b/plug-ins/common/psd-save.c index b3e6067726..85a2c43306 100644 --- a/plug-ins/common/psd-save.c +++ b/plug-ins/common/psd-save.c @@ -1528,9 +1528,9 @@ save_image (const gchar *filename, IFDBG printf (" Function: save_image\n"); if (gimp_image_width (image_id) > 30000 || - gimp_image_height(image_id) > 30000) + gimp_image_height (image_id) > 30000) { - g_message (_("Unable to save '%s'. The psd file format does not support images that are more than 30000 pixels wide or tall."), + g_message (_("Unable to save '%s'. The PSD file format does not support images that are more than 30,000 pixels wide or tall."), gimp_filename_to_utf8 (filename)); return FALSE; } @@ -1542,7 +1542,7 @@ save_image (const gchar *filename, drawable = gimp_drawable_get (layers[i]); if (drawable->width > 30000 || drawable->height > 30000) { - g_message (_("Unable to save '%s'. The psd file format does not support images with layers that are more than 30000 pixels wide or tall."), + g_message (_("Unable to save '%s'. The PSD file format does not support images with layers that are more than 30,000 pixels wide or tall."), gimp_filename_to_utf8 (filename)); g_free (layers); return FALSE;