Closed adrien-delhorme closed 1 year ago
I just created a quick fix (#118). Really, this should be covered by tests and might need a decent rework... Also to include the ideas of https://github.com/django-cms/djangocms-picture/pull/114
@adrien-delhorme Can you test if it works for you?
Fixed by #118
I wondered why my cropping format was not respected.
I found that the following condition is met when the
width
andheight
are not None OR when (width
andheight
are None AND self.picture is None): https://github.com/django-cms/djangocms-frontend/blob/61b5b766fb0256a9e8b426f4d68b4891ccc0f815/djangocms_frontend/contrib/image/models.py#L44-L47So when
width
andheight
are set, we override them with640, 640 / PICTURE_RATIO
...I think we can fully remove the
else
condition. Ifthis.picture
is None, we do not need to worry about its size.