summaryrefslogtreecommitdiff
path: root/src/generators.c
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2009-09-23 12:10:01 +0200
committerTomas Bzatek <tbzatek@users.sourceforge.net>2009-09-23 12:10:01 +0200
commit559fdaeb07024c6b6d0d354900805b61fb262367 (patch)
treecc45bdac9f5534f598f0be503b2cfd6b6d42aa49 /src/generators.c
parentf71553cd2fb7bab75f014f2fe79ea900f4faee5a (diff)
downloadcataract-559fdaeb07024c6b6d0d354900805b61fb262367.tar.xz
Make thumbnail orientation independent of source image orientation
Diffstat (limited to 'src/generators.c')
-rw-r--r--src/generators.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/generators.c b/src/generators.c
index 5e9e64e..b2cf807 100644
--- a/src/generators.c
+++ b/src/generators.c
@@ -110,7 +110,7 @@ generate_image (TGallerySetup *setup,
unsigned int item_index,
const gchar *dst_dir,
gboolean update_when_necessary,
- gboolean *portrait)
+ gboolean *thumb_portrait)
{
unsigned long new_w, new_h;
unsigned long thumb_w, thumb_h;
@@ -123,6 +123,7 @@ generate_image (TGallerySetup *setup,
gchar *s1;
int bigq;
gboolean res;
+ gboolean source_img_portrait;
thumb_src_full = NULL;
@@ -162,14 +163,15 @@ generate_image (TGallerySetup *setup,
if ((new_w > 0) && (new_h > 0)) {
stats_images_inc ();
- *portrait = (new_w / new_h) < 1;
+ source_img_portrait = (new_w / new_h) < 1;
/* Generate thumbnail */
g_assert (thumb_src_full != NULL);
get_image_sizes (thumb_src_full, &thumb_w, &thumb_h);
+ *thumb_portrait = (thumb_w / thumb_h) < 1;
if ((thumb_w > 0) && (thumb_h > 0)) {
- if (! *portrait)
+ if (! *thumb_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);
@@ -192,7 +194,7 @@ generate_image (TGallerySetup *setup,
if ((item->width > 0) && (item->height > 0)) {
calculate_sizes (item->width, item->height, &new_w, &new_h);
} else {
- if (! *portrait) {
+ if (! source_img_portrait) {
if ((items->landscape_width > 0) && (items->landscape_height > 0))
calculate_sizes (items->landscape_width, items->landscape_height, &new_w, &new_h);
else