jonasundderwolf / django-image-cropping

Django helper application to easily and non-destructively crop arbitrarily large images in admin and frontend.
Other
553 stars 130 forks source link

It's possible change cropping size in admin? #84

Closed vparenti closed 8 years ago

vparenti commented 8 years ago

I would change cropping size in ModelAdmin class. It's possible? should I override ImageCroppingMixin? What widget should I modify? Thanks, Vittorino

jonasvp commented 8 years ago

This is mentioned in the documentation: https://github.com/jonasundderwolf/django-image-cropping#thumbnail-size

vparenti commented 8 years ago

Thanks but I don't want set it in settings.py. I want change values in ModelForm class.

anrie commented 8 years ago

Yes, you should subclass the widget (the respective widget depends on your field type; you can see the checks in the formfield_for_dbfield-method of the mixin) and adjust the data-thumbnail-url-attr, so that it points to a thumbnail of your desired size.

Right now things are not as flexible as they could be. In the long run it would be nicer if one could set the desired thumbnail size directly on the widget (with a fallback to settings.IMAGE_CROPPING_THUMB_SIZE).