How can I define imagekit spec from form fields in Django 2.0

17 views
Skip to first unread message

Jacques Rousseauu

unread,
May 25, 2018, 4:54:47 PM5/25/18
to Django ImageKit
How can provide width and height dynamically from form field:

class PostForm(forms.ModelForm):
    image
= ProcessedImageField(spec_id='posts:create:post_image',
                                processors
=[ResizeToFill(width=600, height=400)],
                                format
='JPEG',
                                options
={'quality': 80})
    width_field
= forms.IntegerField()
    height_field
= forms.IntegerField()

Reply all
Reply to author
Forward
0 new messages