All pastes #1381236 Raw Edit

Anonymous

public text v1 · immutable
#1381236 ·published 2009-04-03 20:35 UTC
rendered paste body
diff --git a/src/bin/thumbnailer.c b/src/bin/thumbnailer.c
index eaa6cd2..e72fba2 100644
--- a/src/bin/thumbnailer.c
+++ b/src/bin/thumbnailer.c
@@ -215,6 +215,7 @@ static const char *
 thumbnailer_thumbnail_create(struct thumbnailer *tn, const char *path, int size, int aspect, int width, int height)
 {
     Epsilon *e;
+    const char *folder;
 
     epsilon_init();
     e = epsilon_new(path);
@@ -223,10 +224,20 @@ thumbnailer_thumbnail_create(struct thumbnailer *tn, const char *path, int size,
 
     epsilon_format_set(e, EPSILON_THUMB_JPEG);
     epsilon_aspect_set(e, aspect);
-    if (size == EPSILON_THUMB_NORMAL || size == EPSILON_THUMB_LARGE)
-        epsilon_thumb_size(e, size);
+    if (aspect == EPSILON_THUMB_CROP)
+        folder = "/canola-cropped";
     else
-        epsilon_custom_thumb_size(e, width, height, "/canola");
+        folder = "/canola";
+
+    if (size == EPSILON_THUMB_NORMAL) {
+        width = 128;
+        height = 128;
+    } else if (size == EPSILON_THUMB_LARGE) {
+        width = 256;
+        height = 256;
+    }
+
+    epsilon_custom_thumb_size(e, width, height, folder);
     if (epsilon_exists(e) != EPSILON_OK)
         if (epsilon_generate(e) != EPSILON_OK)
             return NULL;