-diff -upr python-epsilon.orig/epsilon/epsilon.c_epsilon.pyx python-epsilon/epsilon/epsilon.c_epsilon.pyx
---- python-epsilon.orig/epsilon/epsilon.c_epsilon.pyx 2007-11-24 22:50:53.000000000 -0300
-+++ python-epsilon/epsilon/epsilon.c_epsilon.pyx 2007-12-10 18:06:21.000000000 -0300
-@@ -8,6 +8,7 @@ def init():
-
- EPSILON_THUMB_NORMAL = 0
- EPSILON_THUMB_LARGE = 1
-+EPSILON_THUMB_CANOLA = 2
-
- cdef class Epsilon:
- """Epsilon thumbnail generator.
-@@ -21,7 +22,8 @@ cdef class Epsilon:
+From 71e5febf2f353efd9bff187c94d737760ba01b12 Mon Sep 17 00:00:00 2001
+From: Leonardo Sobral Cunha <leonardo.cunha@openbossa.org>
+Date: Sat, 24 Nov 2007 18:50:54 -0300
+Subject: [PATCH] Support for epsilon api for creating custom sized thumbs
+
+---
+ epsilon/epsilon.c_epsilon.pyx | 11 +++++++++--
+ epsilon/epsilon.request.pyx | 6 ++++--
+ include/epsilon/c_epsilon.pxd | 1 +
+ 3 files changed, 14 insertions(+), 4 deletions(-)
+
+diff --git a/epsilon/epsilon.c_epsilon.pyx b/epsilon/epsilon.c_epsilon.pyx
+index cfd58ca..8550884 100644
+--- a/epsilon/epsilon.c_epsilon.pyx
++++ b/epsilon/epsilon.c_epsilon.pyx
+@@ -21,7 +21,7 @@ cdef class Epsilon:
"""Epsilon constructor.
@parm path: full path of image to process.
- @parm thumb_size: one of EPSILON_THUMB_NORMAL or EPSILON_THUMB_LARGE
+ @parm thumb_size: one of EPSILON_THUMB_NORMAL, EPSILON_THUMB_LARGE
-+ or EPSILON_THUMB_CANOLA
@parm key: just used by edje to specify the part to process.
@parm resolution: just used by edje to specify render size.
"""
-@@ -113,9 +115,10 @@ cdef class Epsilon:
- """Specify thumbnail size, either EPSILON_THUMB_NORMAL (128x128) or
+@@ -114,7 +114,7 @@ cdef class Epsilon:
EPSILON_THUMB_LARGE (256x256).
"""
-- if value != EPSILON_THUMB_NORMAL and value != EPSILON_THUMB_LARGE:
+ if value != EPSILON_THUMB_NORMAL and value != EPSILON_THUMB_LARGE:
- raise ValueError("value must be either EPSILON_THUMB_NORMAL or "
-- "EPSILON_THUMB_LARGE")
-+ if value != EPSILON_THUMB_NORMAL and value != EPSILON_THUMB_LARGE and \
-+ value != EPSILON_THUMB_CANOLA:
+ raise ValueError("value must be either EPSILON_THUMB_NORMAL, "
-+ "EPSILON_THUMB_LARGE or EPSILON_THUMB_CANOLA")
+ "EPSILON_THUMB_LARGE")
epsilon_thumb_size(self.obj, value)
- def thumb_size_get(self):
-@@ -123,6 +126,8 @@ cdef class Epsilon:
- if self.obj:
- if self.obj.tw == EPSILON_THUMB_NORMAL:
- return EPSILON_THUMB_NORMAL
-+ elif self.obj.tw == EPSILON_THUMB_CANOLA:
-+ return EPSILON_THUMB_CANOLA
- else:
- return EPSILON_THUMB_LARGE
+@@ -133,6 +133,13 @@ cdef class Epsilon:
+ def __get__(self):
+ return self.thumb_size_get()
-diff -upr python-epsilon.orig/epsilon/epsilon.request.pyx python-epsilon/epsilon/epsilon.request.pyx
---- python-epsilon.orig/epsilon/epsilon.request.pyx 2007-11-24 22:50:53.000000000 -0300
-+++ python-epsilon/epsilon/epsilon.request.pyx 2007-12-10 18:06:21.000000000 -0300
++ def thumb_custom_size_set(self, int w, int h, char *dir):
++ """Specify a custom thumbnail size.
++ """
++ if w <= 0 and h <= 0:
++ raise ValueError("either dimension value must be positive.")
++ epsilon_custom_thumb_size(self.obj, w, h, dir)
++
+ def file_get(self):
+ "@rtype: str"
+ cdef char *s
+diff --git a/epsilon/epsilon.request.pyx b/epsilon/epsilon.request.pyx
+index c9a9fad..eea60da 100644
+--- a/epsilon/epsilon.request.pyx
++++ b/epsilon/epsilon.request.pyx
@@ -13,6 +13,7 @@ def init():
EPSILON_THUMB_NORMAL = 0
if self.obj == NULL:
self.func = func
-diff -upr python-epsilon.orig/epsilon/__init__.py python-epsilon/epsilon/__init__.py
---- python-epsilon.orig/epsilon/__init__.py 2007-11-01 15:46:42.000000000 -0300
-+++ python-epsilon/epsilon/__init__.py 2007-12-10 18:06:21.000000000 -0300
-@@ -1,3 +1,3 @@
- #!/usr/bin/env python
+diff --git a/include/epsilon/c_epsilon.pxd b/include/epsilon/c_epsilon.pxd
+index 6c4a44a..1838d7f 100644
+--- a/include/epsilon/c_epsilon.pxd
++++ b/include/epsilon/c_epsilon.pxd
+@@ -40,6 +40,7 @@ cdef extern from "Epsilon.h":
+ int epsilon_exists(_Epsilon *e)
+ int epsilon_generate(_Epsilon *e)
+ void epsilon_thumb_size(_Epsilon *e, int size)
++ void epsilon_custom_thumb_size(_Epsilon *e, int w, int h, char *dir)
+
+ _Epsilon_Info *epsilon_info_get (_Epsilon *e)
--from c_epsilon import init, EPSILON_THUMB_NORMAL, EPSILON_THUMB_LARGE, Epsilon
-+from c_epsilon import init, EPSILON_THUMB_NORMAL, EPSILON_THUMB_LARGE, EPSILON_THUMB_CANOLA, Epsilon
+--
+1.5.4.3
+