mirror of https://github.com/GNOME/gimp.git
return failure if the thumbnail PNG contains no Thumb::URI tag.
2007-02-18 Michael Natterer <mitch@gimp.org> * libgimpthumb/gimpthumbnail.c (gimp_thumbnail_set_from_thumb): return failure if the thumbnail PNG contains no Thumb::URI tag. svn path=/trunk/; revision=21939
This commit is contained in:
parent
10c117946d
commit
143abfeabd
|
@ -1,3 +1,8 @@
|
|||
2007-02-18 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* libgimpthumb/gimpthumbnail.c (gimp_thumbnail_set_from_thumb):
|
||||
return failure if the thumbnail PNG contains no Thumb::URI tag.
|
||||
|
||||
2007-02-18 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/plug-in/gimppluginprocedure.[ch]: add "locale_domain" and
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
#endif
|
||||
|
||||
#include "gimpthumb-types.h"
|
||||
#include "gimpthumb-error.h"
|
||||
#include "gimpthumb-utils.h"
|
||||
#include "gimpthumbnail.h"
|
||||
|
||||
|
@ -478,6 +479,7 @@ gimp_thumbnail_set_from_thumb (GimpThumbnail *thumbnail,
|
|||
GError **error)
|
||||
{
|
||||
GdkPixbuf *pixbuf;
|
||||
const gchar *uri;
|
||||
|
||||
g_return_val_if_fail (GIMP_IS_THUMBNAIL (thumbnail), FALSE);
|
||||
g_return_val_if_fail (filename != NULL, FALSE);
|
||||
|
@ -489,9 +491,16 @@ gimp_thumbnail_set_from_thumb (GimpThumbnail *thumbnail,
|
|||
if (! pixbuf)
|
||||
return FALSE;
|
||||
|
||||
gimp_thumbnail_set_uri (thumbnail,
|
||||
gdk_pixbuf_get_option (pixbuf, TAG_THUMB_URI));
|
||||
uri = gdk_pixbuf_get_option (pixbuf, TAG_THUMB_URI);
|
||||
if (! uri)
|
||||
{
|
||||
g_set_error (error, GIMP_THUMB_ERROR, 0,
|
||||
_("Thumbnail contains no Thumb::URI tag"));
|
||||
g_object_unref (pixbuf);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gimp_thumbnail_set_uri (thumbnail, uri);
|
||||
g_object_unref (pixbuf);
|
||||
|
||||
return TRUE;
|
||||
|
|
Loading…
Reference in New Issue