diff options
| author | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2011-01-23 18:41:25 +0100 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2011-01-23 18:41:25 +0100 |
| commit | ede4432dab952314a57c94d8e713814e651f83ca (patch) | |
| tree | 97faf17bec0e041cf19d7ec27b41fb8b7c2f4ab0 /src/generators.c | |
| parent | 49abd46d162e1d5013a42947c200544b75ab9da1 (diff) | |
| download | cataract-ede4432dab952314a57c94d8e713814e651f83ca.tar.xz | |
Indentation fixes
Diffstat (limited to 'src/generators.c')
| -rw-r--r-- | src/generators.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/generators.c b/src/generators.c index a11ebcd..a8bdc36 100644 --- a/src/generators.c +++ b/src/generators.c @@ -161,7 +161,7 @@ generate_image (TGallerySetup *setup, if (res) { get_image_sizes (img_src_full, &new_w, &new_h); - if ((new_w > 0) && (new_h > 0)) { + if (new_w > 0 && new_h > 0) { stats_images_inc (); source_img_portrait = (new_w / new_h) < 1; @@ -170,7 +170,7 @@ generate_image (TGallerySetup *setup, 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 (thumb_w > 0 && thumb_h > 0) { /* Squared thumbnails */ if (setup->squared_thumbnail_type != THUMBNAIL_SQUARE_TYPE_NONE) { thumb_w = setup->thumbnail_square_size; @@ -183,8 +183,9 @@ generate_image (TGallerySetup *setup, calculate_sizes (setup->thumbnail_portrait_width, setup->thumbnail_portrait_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 + } else { log_error ("generate_image: thumbnail %s sizes are %lux%lu\n", thumb_src_full, thumb_w, thumb_h); + } /* Generate/copy preview image */ @@ -192,21 +193,21 @@ generate_image (TGallerySetup *setup, if (item->preview == NULL) { /* No preview image supplied, generate it from original */ bigq = setup->preview_quality; - if ((items->quality > 0) && (items->quality <= 100)) + if (items->quality > 0 && items->quality <= 100) bigq = items->quality; - if ((item->quality > 0) && (item->quality <= 100)) + if (item->quality > 0 && item->quality <= 100) bigq = item->quality; - if ((item->width > 0) && (item->height > 0)) { + if (item->width > 0 && item->height > 0) { calculate_sizes (item->width, item->height, &new_w, &new_h); } else { if (! source_img_portrait) { - if ((items->landscape_width > 0) && (items->landscape_height > 0)) + 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 { - if ((items->portrait_width > 0) && (items->portrait_height > 0)) + if (items->portrait_width > 0 && items->portrait_height > 0) calculate_sizes (items->portrait_width, items->portrait_height, &new_w, &new_h); else calculate_sizes (setup->preview_portrait_width, setup->preview_portrait_height, &new_w, &new_h); @@ -217,8 +218,7 @@ generate_image (TGallerySetup *setup, if (! resize_image (img_src_full, big_dst, new_w, new_h, bigq, FALSE, 0)) log_error ("generate_image: error resizing big image %s\n", img_src_full); } - else - { + else { /* Copy the preview (big) image provided */ big_src = g_build_filename (path_info->src_dir, item->preview, NULL); if (! copy_file (big_src, big_dst)) @@ -447,8 +447,7 @@ write_html_album (TGallerySetup *setup, block = g_strdup (""); /* Now we have all block placeholders read, generate the items: */ - for (i = 0; i < items->items->len; i++) - { + for (i = 0; i < items->items->len; i++) { item = g_ptr_array_index (items->items, i); if (item == NULL) { log_error ("write_html_index: error getting item %d\n", i); @@ -686,8 +685,10 @@ write_html_image (TGallerySetup *setup, str_replace (&title_desc, "\n", "<br />"); } } - if (title) title = g_strstrip (title); - if (title_desc) title_desc = g_strstrip (title_desc); + if (title) + title = g_strstrip (title); + if (title_desc) + title_desc = g_strstrip (title_desc); /* Page title */ s1 = (title && strlen (title) > 0) ? g_strdup_printf ("%s | ", title) : NULL; |
