From 69d1615d7dc7500039dbde951fa6cbb920eb99b8 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Sat, 9 Oct 2010 21:20:13 +0200 Subject: Add support for squared thumbnails Disabled by default, only very simple center crop implemented. The SQUARED_SIMPLE_SHAVE_AMOUNT constant may be slightly adjusted according to future experience. It's a really dumb algorithm which may not be suitable for every picture. Looking for a fast and smart algorithm to determine image weight center and radius, i.e. focus on object of interest. The OpenCV's face recognition features are worth to test and consider, though I fear the speed issues. --- src/setup.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/setup.h') diff --git a/src/setup.h b/src/setup.h index 8c9927f..16665c4 100644 --- a/src/setup.h +++ b/src/setup.h @@ -32,6 +32,11 @@ #define DEFAULT_INDEX_FILENAME "index.html" +typedef enum { + THUMBNAIL_SQUARE_TYPE_NONE, + THUMBNAIL_SQUARE_TYPE_SIMPLE +} ThumbnailSquareType; + /* Global gallery setup */ typedef struct { @@ -52,6 +57,7 @@ typedef struct { gchar *img_big_dir; gchar *img_orig_dir; gchar *thumbnail_name_format; + ThumbnailSquareType squared_thumbnail_type; gchar *footer; gchar *meta_author; @@ -65,6 +71,7 @@ typedef struct { unsigned long thumbnail_landscape_height; unsigned long thumbnail_portrait_width; unsigned long thumbnail_portrait_height; + unsigned long thumbnail_square_size; int preview_quality; unsigned long preview_landscape_width; -- cgit v1.2.3