diff options
author | substantialnoninfringinguser <substantialnoninfringinguser@gmail.com> | 2009-05-13 06:23:57 +0100 |
---|---|---|
committer | substantialnoninfringinguser <substantialnoninfringinguser@gmail.com> | 2009-05-13 06:23:57 +0100 |
commit | b31d022c1ab0ee4e33b477f913aeb200ad9e0b58 (patch) | |
tree | ed9aaacfd1b937d4613ea373728116cddabd2b6e /expo/imagekit_specs.py | |
parent | 919c7e932a8e230a970efb8308e71bb10f15a6fb (diff) | |
download | troggle-b31d022c1ab0ee4e33b477f913aeb200ad9e0b58.tar.gz troggle-b31d022c1ab0ee4e33b477f913aeb200ad9e0b58.tar.bz2 troggle-b31d022c1ab0ee4e33b477f913aeb200ad9e0b58.zip |
[svn] Dynamic thumbnail generation for photos and survey scans using imagekit, further improving registration system, other misc.
Copied from http://cucc@cucc.survex.com/svn/trunk/expoweb/troggle/, rev. 8336 by cucc @ 5/10/2009 11:05 PM
Diffstat (limited to 'expo/imagekit_specs.py')
-rw-r--r-- | expo/imagekit_specs.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/expo/imagekit_specs.py b/expo/imagekit_specs.py new file mode 100644 index 0000000..243cb9f --- /dev/null +++ b/expo/imagekit_specs.py @@ -0,0 +1,23 @@ +from imagekit.specs import ImageSpec +from imagekit import processors + +class ResizeThumb(processors.Resize): + width = 100 + height = 75 + crop = True + +class ResizeDisplay(processors.Resize): + width = 600 + +class EnhanceThumb(processors.Adjustment): + contrast = 1.2 + sharpness = 1.1 + +class Thumbnail(ImageSpec): + access_as = 'thumbnail_image' + pre_cache = True + processors = [ResizeThumb, EnhanceThumb] + +class Display(ImageSpec): + increment_count = True + processors = [ResizeDisplay] |