Closed petschki closed 1 year ago
I added a test to verify the desired behavior. Currently the last assert fails, because we allow a height higher than original image, even if it is under the max value of 65536. That does not make sense.
but also the test_create_new_hashkey_for_cropped_images is still failing and i think not without reason.
🙏
In Plone 6 there are image scales with height
65536
in order to make the height calculated flexible when scaling down to the width. This is a problem in cropping editor, because there the flagcan_scale
checks if width and height of scaled image is larger than the original image.To make these scales croppable here's my solution proposal:
can_scale
only checks that the width of the scaled image is lower equal to the original width.65536
we calculate the height for the editor by the ratio of the original width/height.I'm not really happy with the hard coded pixel value though. I also thought about a checkbox in the settings to discard the maximum check for the editor and leave it up to the integrator to constrain the scales to the valid one.
feedback welcome...
see #130