summaryrefslogtreecommitdiff
path: root/gdk-pixbuf/io-jpeg.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2007-04-28 14:48:22 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2007-04-28 14:48:22 +0000
commit793ed9c2c6224a978aeb5df3690f6beed1692ff5 (patch)
tree98bec7371857176fa0b3fb3135de71c5b5fb764c /gdk-pixbuf/io-jpeg.c
parentb72dfb8c4e8d0b3f12a17ff423178eaf44b3c6b5 (diff)
downloadgtk+-793ed9c2c6224a978aeb5df3690f6beed1692ff5.tar.gz
Accept unknown parameters with a warning when saving. (#405539, Daniel
2007-04-28 Matthias Clasen <mclasen@redhat.com> * io-png.c: * io-jpeg.c: Accept unknown parameters with a warning when saving. (#405539, Daniel Atallah) svn path=/trunk/; revision=17673
Diffstat (limited to 'gdk-pixbuf/io-jpeg.c')
-rw-r--r--gdk-pixbuf/io-jpeg.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/gdk-pixbuf/io-jpeg.c b/gdk-pixbuf/io-jpeg.c
index 462a99d1df..477751216e 100644
--- a/gdk-pixbuf/io-jpeg.c
+++ b/gdk-pixbuf/io-jpeg.c
@@ -952,9 +952,7 @@ real_save_jpeg (GdkPixbuf *pixbuf,
return FALSE;
}
} else {
- g_warning ("Bad option name '%s' passed to JPEG saver",
- *kiter);
- return FALSE;
+ g_warning ("Unrecognized parameter (%s) passed to JPEG saver.", *kiter);
}
++kiter;
@@ -970,7 +968,14 @@ real_save_jpeg (GdkPixbuf *pixbuf,
/* no image data? abort */
pixels = gdk_pixbuf_get_pixels (pixbuf);
- g_return_val_if_fail (pixels != NULL, FALSE);
+
+ if (pixels == NULL) {
+ g_set_error (error,
+ GDK_PIXBUF_ERROR,
+ GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
+ _("Image contains no pixels."));
+ return FALSE;
+ }
/* Allocate a small buffer to convert image data,
* and a larger buffer if doing to_callback save.