diff options
Diffstat (limited to 'src/generators.c')
| -rw-r--r-- | src/generators.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/generators.c b/src/generators.c index f53b826..5e9e64e 100644 --- a/src/generators.c +++ b/src/generators.c @@ -109,7 +109,8 @@ generate_image (TGallerySetup *setup, TIndexItem *item, unsigned int item_index, const gchar *dst_dir, - gboolean update_when_necessary) + gboolean update_when_necessary, + gboolean *portrait) { unsigned long new_w, new_h; unsigned long thumb_w, thumb_h; @@ -154,21 +155,21 @@ generate_image (TGallerySetup *setup, res = (! update_when_necessary) || 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); - + /* Do something when necessary */ if (res) { get_image_sizes (img_src_full, &new_w, &new_h); if ((new_w > 0) && (new_h > 0)) { stats_images_inc (); - item->gen_portrait = (new_w / new_h) < 1; + *portrait = (new_w / new_h) < 1; /* Generate thumbnail */ g_assert (thumb_src_full != NULL); get_image_sizes (thumb_src_full, &thumb_w, &thumb_h); if ((thumb_w > 0) && (thumb_h > 0)) { - if (! item->gen_portrait) + if (! *portrait) calculate_sizes (setup->thumbnail_landscape_width, setup->thumbnail_landscape_height, &thumb_w, &thumb_h); else calculate_sizes (setup->thumbnail_portrait_width, setup->thumbnail_portrait_height, &thumb_w, &thumb_h); @@ -191,15 +192,12 @@ generate_image (TGallerySetup *setup, if ((item->width > 0) && (item->height > 0)) { calculate_sizes (item->width, item->height, &new_w, &new_h); } else { - if (! item->gen_portrait) - { + if (! *portrait) { if ((items->landscape_width > 0) && (items->landscape_height > 0)) calculate_sizes (items->landscape_width, items->landscape_height, &new_w, &new_h); else calculate_sizes (setup->preview_landscape_width, setup->preview_landscape_height, &new_w, &new_h); - } - else - { + } else { if ((items->portrait_width > 0) && (items->portrait_height > 0)) calculate_sizes (items->portrait_width, items->portrait_height, &new_w, &new_h); else |
