From a80257130313e320553d63bdb1c745617600eced Mon Sep 17 00:00:00 2001 From: Michael Schumacher Date: Sat, 31 Mar 2007 21:20:51 +0000 Subject: [PATCH] some file load plug-ins did call gimp_quit() in their load functions. This 2007-03-31 Michael Schumacher * plug-ins/common/svg.c: * plug-ins/common/tiff.c: * plug-ins/common/wmf.c: * plug-ins/jpeg/jpeg-load.c: some file load plug-ins did call gimp_quit() in their load functions. This aborts the plug-in instead of returning a GIMP_PDB_EXECUTION_ERROR. The run() function in each plug-in was already prepared to do this on errors. svn path=/trunk/; revision=22212 --- ChangeLog | 11 +++++++++++ plug-ins/common/svg.c | 2 +- plug-ins/common/tiff.c | 10 +++++----- plug-ins/common/wmf.c | 2 +- plug-ins/jpeg/jpeg-load.c | 6 +++--- 5 files changed, 21 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index f257c12850..2d91b0251a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2007-03-31 Michael Schumacher + + * plug-ins/common/svg.c: + * plug-ins/common/tiff.c: + * plug-ins/common/wmf.c: + * plug-ins/jpeg/jpeg-load.c: some file load plug-ins did call + gimp_quit() in their load functions. This aborts the plug-in + instead of returning a GIMP_PDB_EXECUTION_ERROR. The run() + function in each plug-in was already prepared to do this on + errors. + 2007-03-31 Michael Natterer * app/core/gimpdrawable-blend.c: use SQR(x) instead of x*x. diff --git a/plug-ins/common/svg.c b/plug-ins/common/svg.c index 1688ba44a4..6721de8d8d 100644 --- a/plug-ins/common/svg.c +++ b/plug-ins/common/svg.c @@ -320,7 +320,7 @@ load_image (const gchar *filename) g_message (_("Could not open '%s' for reading: %s"), gimp_filename_to_utf8 (filename), error ? error->message : _("Unknown reason")); - gimp_quit (); + return -1; } gimp_progress_init (_("Rendering SVG")); diff --git a/plug-ins/common/tiff.c b/plug-ins/common/tiff.c index 9f916479e6..e2e753ab85 100644 --- a/plug-ins/common/tiff.c +++ b/plug-ins/common/tiff.c @@ -579,7 +579,7 @@ load_image (const gchar *filename) { g_message (_("Could not open '%s' for reading: %s"), gimp_filename_to_utf8 (filename), g_strerror (errno)); - gimp_quit (); + return -1; } TIFFSetWarningHandler (tiff_warning); @@ -607,14 +607,14 @@ load_image (const gchar *filename) { g_message ("Could not get image width from '%s'", gimp_filename_to_utf8 (filename)); - gimp_quit (); + return -1; } if (!TIFFGetField (tif, TIFFTAG_IMAGELENGTH, &rows)) { g_message ("Could not get image length from '%s'", gimp_filename_to_utf8 (filename)); - gimp_quit (); + return -1; } if (!TIFFGetField (tif, TIFFTAG_PHOTOMETRIC, &photomet)) @@ -730,7 +730,7 @@ load_image (const gchar *filename) if ((image = gimp_image_new (cols, rows, image_type)) == -1) { g_message ("Could not create a new image"); - gimp_quit (); + return -1; } gimp_image_undo_disable (image); @@ -907,7 +907,7 @@ load_image (const gchar *filename) { g_message ("Could not get colormaps from '%s'", gimp_filename_to_utf8 (filename)); - gimp_quit (); + return -1; } for (i = 0, j = 0; i < (1 << bps); i++) diff --git a/plug-ins/common/wmf.c b/plug-ins/common/wmf.c index 9b54c45695..6713b19d2a 100644 --- a/plug-ins/common/wmf.c +++ b/plug-ins/common/wmf.c @@ -948,7 +948,7 @@ load_image (const gchar *filename) { g_message (_("Could not open '%s' for reading."), gimp_filename_to_utf8 (filename)); - gimp_quit (); + return -1; } gimp_progress_init_printf (_("Opening '%s'"), diff --git a/plug-ins/jpeg/jpeg-load.c b/plug-ins/jpeg/jpeg-load.c index 433cc211e7..acd4f061de 100644 --- a/plug-ins/jpeg/jpeg-load.c +++ b/plug-ins/jpeg/jpeg-load.c @@ -87,7 +87,7 @@ load_image (const gchar *filename, { g_message (_("Could not open '%s' for reading: %s"), gimp_filename_to_utf8 (filename), g_strerror (errno)); - gimp_quit (); + return -1; } if (!preview) @@ -112,7 +112,7 @@ load_image (const gchar *filename, if (preview) destroy_preview(); - gimp_quit (); + return -1; } /* Now we can initialize the JPEG decompression object. */ @@ -203,7 +203,7 @@ load_image (const gchar *filename, "with %d color channels, using colorspace %d (%d).", cinfo.output_components, cinfo.out_color_space, cinfo.jpeg_color_space); - gimp_quit (); + return -1; break; }