diff options
author | Matthias Clasen <mclasen@redhat.com> | 2007-04-28 14:48:22 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2007-04-28 14:48:22 +0000 |
commit | 793ed9c2c6224a978aeb5df3690f6beed1692ff5 (patch) | |
tree | 98bec7371857176fa0b3fb3135de71c5b5fb764c /gdk-pixbuf | |
parent | b72dfb8c4e8d0b3f12a17ff423178eaf44b3c6b5 (diff) | |
download | gtk+-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')
-rw-r--r-- | gdk-pixbuf/ChangeLog | 6 | ||||
-rw-r--r-- | gdk-pixbuf/io-jpeg.c | 13 | ||||
-rw-r--r-- | gdk-pixbuf/io-png.c | 12 |
3 files changed, 20 insertions, 11 deletions
diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index cb6430c652..124194a9da 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -1,3 +1,9 @@ +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) + 2007-04-25 Matthias Clasen <mclasen@redhat.com> * gdk-pixbuf-simple-anim.c (gdk_pixbuf_simple_anim_add_frame): 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. diff --git a/gdk-pixbuf/io-png.c b/gdk-pixbuf/io-png.c index 6e6398bdfe..117f7372ee 100644 --- a/gdk-pixbuf/io-png.c +++ b/gdk-pixbuf/io-png.c @@ -343,8 +343,8 @@ gdk_pixbuf__png_image_load (FILE *f, GError **error) static void png_error_callback (png_structp png_read_ptr, png_const_charp error_msg); -static void png_warning_callback(png_structp png_read_ptr, - png_const_charp warning_msg); +static void png_warning_callback (png_structp png_read_ptr, + png_const_charp warning_msg); /* Called at the start of the progressive load */ static void png_info_callback (png_structp png_read_ptr, @@ -738,8 +738,8 @@ png_error_callback(png_structp png_read_ptr, } static void -png_warning_callback(png_structp png_read_ptr, - png_const_charp warning_msg) +png_warning_callback (png_structp png_read_ptr, + png_const_charp warning_msg) { LoadContext* lc; @@ -860,9 +860,7 @@ static gboolean real_save_png (GdkPixbuf *pixbuf, return FALSE; } } else { - g_warning ("Bad option name '%s' passed to PNG saver", - *kiter); - return FALSE; + g_warning ("Unrecognized parameter (%s) passed to PNG saver.", *kiter); } ++kiter; |