Re: g_warnings in png loader



Matthias Clasen <maclas gmx de> writes:
> I stumbled over some g_warnings in io-png.c which can be triggered by
> bad/unexpected data. Examples are:
> 
> in png_text_to_pixbuf_option:
>  g_warning ("Couldn't convert PNG text chunk value to UTF-8.");
> 
> (I think it would be better to silently skip the bad text chunk here)
> 
> 
> in gdk_pixbuf__png_image_load:
>  g_warning ("Got multiple tEXt chunks for the same key.");
> 
> (This is not forbidden by the PNG spec - with 1.2 you can have localized
> itxt chunks, so there could be a "Description" for "de" and another one
> for "en". I think we should silently pick one of the chunks, either
> simply the first one, or try to be fancy and match the locale. I guess
> adding API for localized pixbuf options would be over the top)  
>

Agree with all of the above.
 
> in gdk_pixbuf__png_image_save:
>  g_warning ("Bad option name '%s' passed to PNG saver", *kiter);
> 
> (This is a programming error which should be signalled by setting the
>  GError).

One of the big points in my lengthy GError docs is, never use GError
to report a programming error. g_warning() is correct for programming
errors. GError is for errors that the program might handle.  You would
never write code to handle other buggy code, you would instead fix the
buggy code.

Havoc



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]