summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--generators.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/generators.c b/generators.c
index f2aaa31..5eb7fde 100644
--- a/generators.c
+++ b/generators.c
@@ -39,6 +39,7 @@ void
generate_image (TGallerySetup *setup,
TAlbum *items,
TIndexItem *item,
+ unsigned int item_index,
const char *dst,
unsigned long *img_w, unsigned long *img_h,
char **img_src, char **thumb)
@@ -66,7 +67,9 @@ generate_image (TGallerySetup *setup,
img_src_full = g_strconcat (items->base_dir, "/", item->thumbnail, NULL);
thumb_src_full = g_strconcat (items->base_dir, "/", item->thumbnail, NULL);
*img_src = g_path_get_basename (item->thumbnail);
- *thumb = g_path_get_basename (item->thumbnail);
+ s1 = g_path_get_basename (item->thumbnail);
+ *thumb = g_strdup_printf ("thn_%.3d_%s", item_index, s1);
+ g_free (s1);
}
else
if (items->type == GALLERY_TYPE_ALBUM) {
@@ -75,7 +78,9 @@ generate_image (TGallerySetup *setup,
img_src_full = g_strconcat (items->base_dir, "/", *img_src, NULL);
thumb_src_full = g_strconcat (items->base_dir, "/", *thumb, NULL);
*img_src = g_path_get_basename (*img_src);
- *thumb = g_path_get_basename (*thumb);
+ s1 = g_path_get_basename (*thumb);
+ *thumb = g_strdup_printf ("thn_%.3d_%s", item_index, s1);
+ g_free (s1);
}
get_image_sizes (img_src_full, img_w, img_h);
@@ -446,7 +451,7 @@ write_html_album (TGallerySetup *setup,
switch (item->type) {
case INDEX_ITEM_TYPE_PICTURE:
- generate_image (setup, items, item, dst, &img_w, &img_h, &img_src, &thumb);
+ generate_image (setup, items, item, i, dst, &img_w, &img_h, &img_src, &thumb);
/* Skip HTML code generation if it's a hidden item */
if (! item->hidden) {
if (img_w == 0 || img_h == 0 || (img_w / img_h) >= 1)