1 diff -upNr epsilon/src/lib/Epsilon.c epsilon.new/src/lib/Epsilon.c
2 --- epsilon/src/lib/Epsilon.c 2008-03-06 10:50:30.000000000 -0300
3 +++ epsilon.new/src/lib/Epsilon.c 2008-05-08 13:53:26.000000000 -0300
8 +#define THUMB_HEIGHT_CANOLA 96
9 +#define THUMB_WIDTH_CANOLA 192
10 +#define THUMB_SIZE_CANOLA 192
11 #define THUMB_SIZE_NORMAL 128
12 #define THUMB_SIZE_LARGE 256
13 #define THUMB_SIZE_FAIL -1
16 static char *PATH_DIR_LARGE = NULL;
17 static char *PATH_DIR_NORMAL = NULL;
18 +static char *PATH_DIR_CANOLA = NULL;
19 static char *PATH_DIR_FAIL = NULL;
20 static unsigned LEN_DIR_LARGE = 0;
21 static unsigned LEN_DIR_NORMAL = 0;
22 +static unsigned LEN_DIR_CANOLA = 0;
23 static unsigned LEN_DIR_FAIL = 0;
26 @@ -153,6 +158,11 @@ epsilon_init (void)
27 PATH_DIR_NORMAL = strdup(buf);
28 LEN_DIR_NORMAL = strlen(buf);
30 + if (!PATH_DIR_CANOLA) {
31 + strncpy(buf + base_len, "/canola", PATH_MAX - base_len);
32 + PATH_DIR_CANOLA = strdup(buf);
33 + LEN_DIR_CANOLA = strlen(buf);
36 strncpy(buf + base_len, "/fail/epsilon", PATH_MAX - base_len);
37 PATH_DIR_FAIL = strdup(buf);
38 @@ -161,6 +171,7 @@ epsilon_init (void)
40 ecore_file_mkpath(PATH_DIR_LARGE);
41 ecore_file_mkpath(PATH_DIR_NORMAL);
42 + ecore_file_mkpath(PATH_DIR_CANOLA);
43 ecore_file_mkpath(PATH_DIR_FAIL);
45 plugins_mime = ecore_hash_new(ecore_str_hash, ecore_str_compare);
46 @@ -446,6 +457,11 @@ _epsilon_file_name(unsigned thumb_size,
47 dir = PATH_DIR_NORMAL;
48 dir_len = LEN_DIR_NORMAL;
50 + else if (thumb_size == THUMB_SIZE_CANOLA)
52 + dir = PATH_DIR_CANOLA;
53 + dir_len = LEN_DIR_CANOLA;
58 @@ -575,15 +591,16 @@ epsilon_generate (Epsilon * e)
59 _epsilon_file_name(e->tw, e->hash, "jpg", outfile, sizeof(outfile));
60 epeg_thumbnail_comments_get (im, &info);
61 epeg_size_get (im, &iw, &ih);
63 + /* XXX - hack to force fixed height in case of tw != th (canola) */
64 + if (iw > ih && tw == th)
66 - th = e->th * ((double) ih / (double) iw);
68 + th = ((unsigned long) e->tw * ih) / iw;
73 - tw = e->tw * ((double) iw / (double) ih);
75 + tw = ((unsigned long) e->th * iw) / ih;
78 epeg_decode_size_set (im, tw, th);
79 epeg_quality_set (im, 100);
80 @@ -695,18 +712,19 @@ epsilon_generate (Epsilon * e)
84 - iw = imlib_image_get_width ();
85 - ih = imlib_image_get_height ();
88 - th = e->th * ((double) ih / (double) iw);
93 - tw = e->tw * ((double) iw / (double) ih);
96 + iw = imlib_image_get_width ();
97 + ih = imlib_image_get_height ();
98 + /* XXX - hack to force fixed height in case of tw != th (canola) */
99 + if (iw > ih && tw == th)
101 + th = ((unsigned long) e->tw * ih) / iw;
102 + if (th < 1) th = 1;
106 + tw = ((unsigned long) e->th * iw) / ih;
107 + if (tw < 1) tw = 1;
109 imlib_context_set_cliprect (0, 0, tw, th);
110 if ((src = imlib_create_cropped_scaled_image (0, 0, iw, ih, tw, th)))
112 @@ -749,7 +767,11 @@ epsilon_thumb_size(Epsilon *e, Epsilon_T
113 e->tw = THUMB_SIZE_LARGE;
114 e->th = THUMB_SIZE_LARGE;
117 + case EPSILON_THUMB_CANOLA:
118 + e->tw = THUMB_WIDTH_CANOLA;
119 + e->th = THUMB_HEIGHT_CANOLA;
125 diff -upNr epsilon/src/lib/Epsilon.h epsilon.new/src/lib/Epsilon.h
126 --- epsilon/src/lib/Epsilon.h 2008-03-06 10:50:30.000000000 -0300
127 +++ epsilon.new/src/lib/Epsilon.h 2008-05-08 13:53:26.000000000 -0300
128 @@ -58,7 +58,8 @@ typedef struct _Epsilon_Info Epsilon_Inf
129 enum _Epsilon_Thumb_Size
131 EPSILON_THUMB_NORMAL,
132 - EPSILON_THUMB_LARGE
133 + EPSILON_THUMB_LARGE,
134 + EPSILON_THUMB_CANOLA
137 typedef enum _Epsilon_Thumb_Size Epsilon_Thumb_Size;
138 diff -upNr epsilon/src/lib/epsilon_thumb.c epsilon.new/src/lib/epsilon_thumb.c
139 --- epsilon/src/lib/epsilon_thumb.c 2008-03-06 10:50:30.000000000 -0300
140 +++ epsilon.new/src/lib/epsilon_thumb.c 2008-05-08 13:53:26.000000000 -0300
141 @@ -218,6 +218,9 @@ epsilon_cb_server_data(void *data, int t
142 if (e->server != epsilon_server)
145 + if (!(e && e->data))
149 Epsilon_Request *thumb;
151 diff -upNr epsilon/src/lib/exiftags/canon.c epsilon.new/src/lib/exiftags/canon.c
152 --- epsilon/src/lib/exiftags/canon.c 2008-03-06 10:50:30.000000000 -0300
153 +++ epsilon.new/src/lib/exiftags/canon.c 2008-05-08 13:53:26.000000000 -0300
157 struct descrip *table;
158 - const char descr[];