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
This commit is contained in:
		 Matthias Clasen
					Matthias Clasen
				
			
				
					committed by
					
						 Matthias Clasen
						Matthias Clasen
					
				
			
			
				
	
			
			
			 Matthias Clasen
						Matthias Clasen
					
				
			
						parent
						
							b72dfb8c4e
						
					
				
				
					commit
					793ed9c2c6
				
			| @ -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): | ||||
|  | ||||
| @ -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. | ||||
|  | ||||
| @ -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; | ||||
|  | ||||
		Reference in New Issue
	
	Block a user