easy-thumbnails

Easy thumbnails for Django

=============== Easy Thumbnails =============== A powerful, yet easy to implement thumbnailing application for Django. Below is a quick summary of usage. For more comprehensive information, view the full documentation__ online or the peruse the project’s docs directory. __ http://easy-thumbnails.readthedocs.org/en/latest/index.html Installation ============ Run pip install easy_thumbnails, or for the in-development version__ run pip install easy_thumbnails==dev. __ https://github.com/SmileyChris/easy-thumbnails/tarball/master#egg=easy_thumbnails-dev Add easy_thumbnails to your INSTALLED_APPS setting:: INSTALLED_APPS = ( … ‘easy_thumbnails’, ) If you have South installed then run manage.py migrate easy_thumbnails, otherwise just run manage.py syncdb. Example usage ============= Thumbnail options can be predefined in settings.THUMBNAIL_ALIASES or just specified in the template or Python code when run. Using a predefined alias ———————— Given the following setting:: THUMBNAIL_ALIASES = { “: { ‘avatar’: {‘size’: (50, 50), ‘crop’: True}, }, } Template:: {% load thumbnail %} Python:: from easy_thumbnails.files import get_thumbnailer thumb_url = get_thumbnailer(profile.photo)[‘avatar’].url Manually specifying size / options ———————————- Template:: {% load thumbnail %} Accessing the field’s predefined alias in Python code:: thumb_url = profile.photo[‘avatar’].url Thumbnail options ================= crop ——– Before scaling the image down to fit within the size bounds, it first cuts the edges of the image to match the requested aspect ratio. Use crop="smart" to try to keep the most interesting part of the image, Use crop="0,10" to crop from the left edge and a 10% offset from the top edge. Crop from a single edge by leaving dimension empty (e.g. crop=",0"). Offset from the right / bottom by using negative numbers (e.g., crop=”-0,-10”). Often used with the upscale option, which will allow enlarging of the image during scaling. quality=XX ————– Changes the quality of the output JPEG thumbnail. Defaults to 85. In Python code, this is given as a separate option to the get_thumbnail method rather than just alter the other Other options ————- Valid thumbnail options are determined by the “thumbnail processors” installed. See the reference documentation__ for a complete list of options provided by the default thumbnail processors. __ http://easy-thumbnails.readthedocs.org/en/latest/ref/processors/

Related Repositories

easy-thumbnails

easy-thumbnails

Easy thumbnails for Django ...

image-diet

image-diet

A Django application for removing unnecessary bytes from images. Integrates seemlessly with Easy Thumbnails. ...

video-thumbnails

video-thumbnails

WordPress Plugin that allows easy discovery of thumbnails from embedded videos ...

crop-thumbnails

crop-thumbnails

"Crop Thumbnails" made it easy to get exacly that specific image-detail you want to show. Crop your images the simple way. ...

django-filer

django-filer

File and Image Management Application for django. NOTICE: django-filer 0.8.2 does not work correctly with easy-thumbnails 1.0-alpha-17. please use 1.0-alpha-16 ...


Top Contributors

SmileyChris samluescher jezdez danielsokolowski passy stefanfoulis camilonova rofrankel DrMeers vicalloy selwin grahamking jaap3 smacker amenasse bmihelac danielgatis SilverTab jonasvp mitar mauler tomwardill artscoop