#4115: contrib.thumbnails
---------------------------+------------------------------------------------
Reporter: SmileyChris | Owner: nobody
Status: new | Component: Contrib apps
Version: SVN | Resolution:
Keywords: | Stage: Design decision needed
Has_patch: 1 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
---------------------------+------------------------------------------------
Comment (by Kellen):
With regards to ThumbnailTooSmall, if one is using the thumbnail template
filters for general-purpose resizing, then returning nothing to the
template causes it to fail really ungracefully. I agree that returning the
original image (with proper size info) is much, much better than failing.
This could be achieved by just returning the original image data instead
of resized data. I personally think it's okay to replicate the image on
disk with the expected filename as this will actually be of a smaller
filesize than a generated thumbnail. It would be better to just return a
Thumbnail object with the relevant data for the original image. The first
option is easier to implement:
{{{
# diff methods.py methods.py.orig
10c10,11
< return img
---
> raise ThumbnailTooSmall('Image should be at least %s wide or %s
high' %
> tuple(size))
21c22,23
< return img
---
> raise ThumbnailTooSmall('Image must be at least %s wide and %s
high' %
> tuple(size))
30c32,33
< return img
---
> raise ThumbnailTooSmall('Image must be at least %s wide and %s
high' %
> tuple(size))
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/4115#comment:48>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---