mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-04 01:43:24 +00:00
added new function gimp_thumbnail_set_from_thumb() which will be useful
2004-01-06 Sven Neumann <sven@gimp.org> * libgimpthumb/gimpthumbnail.[ch]: added new function gimp_thumbnail_set_from_thumb() which will be useful when writing a thumbnail manager based on libgimpthumb.
This commit is contained in:
parent
f831818a1a
commit
8099e69264
3 changed files with 65 additions and 20 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2004-01-06 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* libgimpthumb/gimpthumbnail.[ch]: added new function
|
||||||
|
gimp_thumbnail_set_from_thumb() which will be useful when writing
|
||||||
|
a thumbnail manager based on libgimpthumb.
|
||||||
|
|
||||||
2004-01-06 Sven Neumann <sven@gimp.org>
|
2004-01-06 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* app/core/gimpimagefile.c: invalidate the description string
|
* app/core/gimpimagefile.c: invalidate the description string
|
||||||
|
|
|
@ -427,6 +427,42 @@ gimp_thumbnail_set_filename (GimpThumbnail *thumbnail,
|
||||||
return (!filename || uri);
|
return (!filename || uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gimp_thumbnail_set_from_thumb:
|
||||||
|
* @thumbnail: a #GimpThumbnail object
|
||||||
|
* @filename: filename of a local thumbnail file
|
||||||
|
* @error: return location for possible errors
|
||||||
|
*
|
||||||
|
* This function tries to load the thumbnail file pointed to by
|
||||||
|
* @filename and retrieves the URI of the original image file from
|
||||||
|
* it. This allows you to find the image file associated with a
|
||||||
|
* thumbnail file.
|
||||||
|
*
|
||||||
|
* Return value: %TRUE if the pixbuf could be loaded, %FALSE otherwise
|
||||||
|
**/
|
||||||
|
gboolean
|
||||||
|
gimp_thumbnail_set_from_thumb (GimpThumbnail *thumbnail,
|
||||||
|
const gchar *filename,
|
||||||
|
GError **error)
|
||||||
|
{
|
||||||
|
GdkPixbuf *pixbuf;
|
||||||
|
|
||||||
|
g_return_val_if_fail (GIMP_IS_THUMBNAIL (thumbnail), FALSE);
|
||||||
|
g_return_val_if_fail (filename != NULL, FALSE);
|
||||||
|
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||||
|
|
||||||
|
pixbuf = gdk_pixbuf_new_from_file (filename, error);
|
||||||
|
if (! pixbuf)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
gimp_thumbnail_set_uri (thumbnail,
|
||||||
|
gdk_pixbuf_get_option (pixbuf, TAG_THUMB_URI));
|
||||||
|
|
||||||
|
g_object_unref (pixbuf);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gimp_thumbnail_peek_image:
|
* gimp_thumbnail_peek_image:
|
||||||
* @thumbnail: a #GimpThumbnail object
|
* @thumbnail: a #GimpThumbnail object
|
||||||
|
|
|
@ -69,30 +69,33 @@ struct _GimpThumbnailClass
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
GType gimp_thumbnail_get_type (void) G_GNUC_CONST;
|
GType gimp_thumbnail_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
GimpThumbnail * gimp_thumbnail_new (void);
|
GimpThumbnail * gimp_thumbnail_new (void);
|
||||||
|
|
||||||
void gimp_thumbnail_set_uri (GimpThumbnail *thumbnail,
|
void gimp_thumbnail_set_uri (GimpThumbnail *thumbnail,
|
||||||
const gchar *uri);
|
const gchar *uri);
|
||||||
gboolean gimp_thumbnail_set_filename (GimpThumbnail *thumbnail,
|
gboolean gimp_thumbnail_set_filename (GimpThumbnail *thumbnail,
|
||||||
const gchar *filename,
|
const gchar *filename,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
gboolean gimp_thumbnail_set_from_thumb (GimpThumbnail *thumbnail,
|
||||||
|
const gchar *filename,
|
||||||
|
GError **error);
|
||||||
|
|
||||||
GimpThumbState gimp_thumbnail_peek_image (GimpThumbnail *thumbnail);
|
GimpThumbState gimp_thumbnail_peek_image (GimpThumbnail *thumbnail);
|
||||||
GimpThumbState gimp_thumbnail_peek_thumb (GimpThumbnail *thumbnail,
|
GimpThumbState gimp_thumbnail_peek_thumb (GimpThumbnail *thumbnail,
|
||||||
GimpThumbSize size);
|
GimpThumbSize size);
|
||||||
|
|
||||||
GdkPixbuf * gimp_thumbnail_load_thumb (GimpThumbnail *thumbnail,
|
GdkPixbuf * gimp_thumbnail_load_thumb (GimpThumbnail *thumbnail,
|
||||||
GimpThumbSize size,
|
GimpThumbSize size,
|
||||||
GError **error);
|
GError **error);
|
||||||
gboolean gimp_thumbnail_save_thumb (GimpThumbnail *thumbnail,
|
gboolean gimp_thumbnail_save_thumb (GimpThumbnail *thumbnail,
|
||||||
GdkPixbuf *pixbuf,
|
GdkPixbuf *pixbuf,
|
||||||
const gchar *software,
|
const gchar *software,
|
||||||
GError **error);
|
GError **error);
|
||||||
gboolean gimp_thumbnail_save_failure (GimpThumbnail *thumbnail,
|
gboolean gimp_thumbnail_save_failure (GimpThumbnail *thumbnail,
|
||||||
const gchar *software,
|
const gchar *software,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue