summaryrefslogtreecommitdiff
path: root/thumbnails.c
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2009-12-24 05:15:34 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2009-12-24 05:15:34 +0100
commit6604eee92ac1fe6ac07a098fe94bf640e6de023e (patch)
tree3d7459da7197bf2b83a917310c1e7e85a3140cc4 /thumbnails.c
parent78e1dc3199ff8408ea7e297ff5f985ee29938ea8 (diff)
MTime, Image::Width and Image::Height are now added properly to generated thumbnails.
NOTE: The thumbnail code doesn't yet check MTime when loading thumbnails.
Diffstat (limited to 'thumbnails.c')
-rw-r--r--thumbnails.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/thumbnails.c b/thumbnails.c
index d669c99..e88c19d 100644
--- a/thumbnails.c
+++ b/thumbnails.c
@@ -37,7 +37,7 @@ GdkPixbuf *get_thumbnail(const gchar *filepath) {
gint win_width, win_height, img_width, img_height, width, height;
gdouble scalex, scaley, width_ratio, height_ratio, max_ratio;
GError *error = NULL;
- gchar *thumbname;
+ gchar *thumbname, *mtime, *width_s, *height_s;
thumbname = get_wall_thumb_name(filepath);
@@ -76,15 +76,23 @@ GdkPixbuf *get_thumbnail(const gchar *filepath) {
g_object_unref(pb);
error = NULL;
+ mtime = g_strdup_printf("%d", get_mtime(filepath));
+ width_s = g_strdup_printf("%d", img_width);
+ height_s = g_strdup_printf("%d", img_height);
if(!gdk_pixbuf_save(pb2, thumbname, "png", &error,
"tEXt::Thumb::URI", filepath,
- "tEXt::Thumb::MTime", get_mtime(filepath),
+ "tEXt::Thumb::MTime", mtime,
"tEXt::Software", "walls",
+ "tEXt::Thumb::Image::Width", width_s,
+ "tEXt::Thumb::Image::Height", height_s,
NULL)) {
g_warning("%s", error->message);
g_error_free(error);
}
+ g_free(mtime);
+ g_free(width_s);
+ g_free(height_s);
g_free(thumbname);
return pb2;