summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2011-03-26 11:01:30 +0100
committerTomas Bzatek <tbzatek@users.sourceforge.net>2011-03-26 11:01:30 +0100
commit6707d9314ceedb12bfd995b924af4de6b9110800 (patch)
treeb0ccef33e7491461990bd910e7edb0030d036e91 /src
parent9e0b38895913af6513e975bca17ad828fedd1bf4 (diff)
downloadcataract-6707d9314ceedb12bfd995b924af4de6b9110800.tar.xz
Don't generate thumbnails for hidden items
Diffstat (limited to 'src')
-rw-r--r--src/generators.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/generators.c b/src/generators.c
index c9fc4ef..95bed37 100644
--- a/src/generators.c
+++ b/src/generators.c
@@ -152,7 +152,7 @@ generate_image (TGallerySetup *setup,
if (item->force_fullsize || setup->override_nofullsize || (items->fullsize && ! item->force_nofullsize) ||
(! item->force_nofullsize && ! items->nofullsize && ! setup->nofullsize))
orig_dst = g_build_filename (path_info->dest_dir, setup->img_orig_dir, s1, NULL);
- res = (! update_when_necessary) || needs_update (thumb_src_full, thumb_dst) ||
+ res = (! update_when_necessary) || (! item->hidden && needs_update (thumb_src_full, thumb_dst)) ||
(items->type == GALLERY_TYPE_ALBUM && (needs_update (img_src_full, big_dst) || (orig_dst && needs_update (img_src_full, orig_dst))));
g_free (s1);
@@ -169,18 +169,20 @@ generate_image (TGallerySetup *setup,
get_image_sizes (thumb_src_full, &thumb_w, &thumb_h);
if (thumb_w > 0 && thumb_h > 0) {
- /* Squared thumbnails */
- if (setup->squared_thumbnail_type != THUMBNAIL_SQUARE_TYPE_NONE) {
- thumb_w = setup->thumbnail_square_size;
- thumb_h = setup->thumbnail_square_size;
- } else
- /* Portrait / Landscape thumbnails */
- if (thumb_h > thumb_w)
- calculate_sizes (setup->thumbnail_portrait_width, setup->thumbnail_portrait_height, &thumb_w, &thumb_h);
- else
- calculate_sizes (setup->thumbnail_landscape_width, setup->thumbnail_landscape_height, &thumb_w, &thumb_h);
- if (! resize_image (thumb_src_full, thumb_dst, thumb_w, thumb_h, setup->thumbnail_quality, TRUE, setup->squared_thumbnail_type))
- log_error ("generate_image: error resizing thumbnail %s\n", thumb_src_full);
+ if (! item->hidden) {
+ /* Squared thumbnails */
+ if (setup->squared_thumbnail_type != THUMBNAIL_SQUARE_TYPE_NONE) {
+ thumb_w = setup->thumbnail_square_size;
+ thumb_h = setup->thumbnail_square_size;
+ } else
+ /* Portrait / Landscape thumbnails */
+ if (thumb_h > thumb_w)
+ calculate_sizes (setup->thumbnail_portrait_width, setup->thumbnail_portrait_height, &thumb_w, &thumb_h);
+ else
+ calculate_sizes (setup->thumbnail_landscape_width, setup->thumbnail_landscape_height, &thumb_w, &thumb_h);
+ if (! resize_image (thumb_src_full, thumb_dst, thumb_w, thumb_h, setup->thumbnail_quality, TRUE, setup->squared_thumbnail_type))
+ log_error ("generate_image: error resizing thumbnail %s\n", thumb_src_full);
+ }
} else {
log_error ("generate_image: thumbnail %s sizes are %lux%lu\n", thumb_src_full, thumb_w, thumb_h);
}