1 diff --git a/src/lib/Epsilon.c b/src/lib/Epsilon.c
2 index c1d769e..e01f714 100644
3 --- a/src/lib/Epsilon.c
4 +++ b/src/lib/Epsilon.c
9 +#define THUMB_HEIGHT_CANOLA 96
10 +#define THUMB_WIDTH_CANOLA 192
11 +#define THUMB_SIZE_CANOLA 192
12 #define THUMB_SIZE_NORMAL 128
13 #define THUMB_SIZE_LARGE 256
14 #define THUMB_SIZE_FAIL -1
17 static char *PATH_DIR_LARGE = NULL;
18 static char *PATH_DIR_NORMAL = NULL;
19 +static char *PATH_DIR_CANOLA = NULL;
20 static char *PATH_DIR_FAIL = NULL;
21 static unsigned LEN_DIR_LARGE = 0;
22 static unsigned LEN_DIR_NORMAL = 0;
23 +static unsigned LEN_DIR_CANOLA = 0;
24 static unsigned LEN_DIR_FAIL = 0;
27 @@ -153,6 +158,11 @@ epsilon_init (void)
28 PATH_DIR_NORMAL = strdup(buf);
29 LEN_DIR_NORMAL = strlen(buf);
31 + if (!PATH_DIR_CANOLA) {
32 + strncpy(buf + base_len, "/canola", PATH_MAX - base_len);
33 + PATH_DIR_CANOLA = strdup(buf);
34 + LEN_DIR_CANOLA = strlen(buf);
37 strncpy(buf + base_len, "/fail/epsilon", PATH_MAX - base_len);
38 PATH_DIR_FAIL = strdup(buf);
39 @@ -161,6 +171,7 @@ epsilon_init (void)
41 ecore_file_mkpath(PATH_DIR_LARGE);
42 ecore_file_mkpath(PATH_DIR_NORMAL);
43 + ecore_file_mkpath(PATH_DIR_CANOLA);
44 ecore_file_mkpath(PATH_DIR_FAIL);
46 plugins_mime = ecore_hash_new(ecore_str_hash, ecore_str_compare);
47 @@ -446,6 +457,11 @@ _epsilon_file_name(unsigned thumb_size, const char *hash, const char *ext, char
48 dir = PATH_DIR_NORMAL;
49 dir_len = LEN_DIR_NORMAL;
51 + else if (thumb_size == THUMB_SIZE_CANOLA)
53 + dir = PATH_DIR_CANOLA;
54 + dir_len = LEN_DIR_CANOLA;
59 @@ -563,10 +579,10 @@ epsilon_generate (Epsilon * e)
61 if (!e || !e->src || !e->hash)
62 return (EPSILON_FAIL);
70 len = strlen (e->src);
72 @@ -575,7 +591,8 @@ epsilon_generate (Epsilon * e)
73 _epsilon_file_name(e->tw, e->hash, "jpg", outfile, sizeof(outfile));
74 epeg_thumbnail_comments_get (im, &info);
75 epeg_size_get (im, &iw, &ih);
77 + /* XXX - hack to force fixed height in case of tw != th (canola) */
78 + if (iw > ih && tw == th)
80 th = ((unsigned long) e->tw * ih) / iw;
82 @@ -697,7 +714,8 @@ epsilon_generate (Epsilon * e)
84 iw = imlib_image_get_width ();
85 ih = imlib_image_get_height ();
87 + /* XXX - hack to force fixed height in case of tw != th (canola) */
88 + if (iw > ih && tw == th)
90 th = ((unsigned long) e->tw * ih) / iw;
92 @@ -738,7 +756,7 @@ void
93 epsilon_thumb_size(Epsilon *e, Epsilon_Thumb_Size size)
100 case EPSILON_THUMB_NORMAL:
101 @@ -749,7 +767,11 @@ epsilon_thumb_size(Epsilon *e, Epsilon_Thumb_Size size)
102 e->tw = THUMB_SIZE_LARGE;
103 e->th = THUMB_SIZE_LARGE;
106 + case EPSILON_THUMB_CANOLA:
107 + e->tw = THUMB_WIDTH_CANOLA;
108 + e->th = THUMB_HEIGHT_CANOLA;
114 diff --git a/src/lib/Epsilon.h b/src/lib/Epsilon.h
115 index 90a51b3..05ff2f7 100644
116 --- a/src/lib/Epsilon.h
117 +++ b/src/lib/Epsilon.h
118 @@ -58,7 +58,8 @@ typedef struct _Epsilon_Info Epsilon_Info;
119 enum _Epsilon_Thumb_Size
121 EPSILON_THUMB_NORMAL,
122 - EPSILON_THUMB_LARGE
123 + EPSILON_THUMB_LARGE,
124 + EPSILON_THUMB_CANOLA
127 typedef enum _Epsilon_Thumb_Size Epsilon_Thumb_Size;