0

Has anyone tried to use all of these features together? I can combine only any 2 of them together, but cant figure out how to use all 3, and i definitely need it. I want free cropping to be done from admin(to choose which part of image will be displayed in result), get it watermarked and use some thumbnail alias to resize/compress it via easy thumbnails.

It should be something like this: {% cropped_thumbnail Event.photo.pure_events_list.url|watermark:"General watermark" "cropping_free" %} Where: pure_events_list is thumbnail alias for easy thumbnails |watermark:"General watermark" is filter to get image watermarked by url and return new url of watermarked image

Thanks in advance for any help!

LinPy fan
  • 179
  • 1
  • 11

2 Answers2

1

Check this module for easy_thumbnails.. https://pypi.python.org/pypi/django-easy-thumbnails-watermark/0.6.2 P.S. If you're using python 3 need to adapt few lines in the module

Aurimas
  • 46
  • 2
0

You must create new templatetag:

from image_cropping.templatetags.cropping import cropped_thumbnail
from watermarker.templatetags.watermark import watermark

@register.simple_tag(takes_context=True)
def cropped_watermarked_thumbnail(context, instance, ratiofieldname, **kwargs):
    watermark_params = kwargs.pop('watermark', '')
    cropped_image_url = cropped_thumbnail(context, instance, ratiofieldname, **kwargs)
    return watermark(cropped_image_url, watermark_params)

And use it in your template:

<img src="{% cropped_watermarked_thumbnail product 'crop' scale=1 upscale=True watermark='Watermark,position=C,opacity=100' %}">