Problem/Motivation
@berdir noticed, in the UI, that it's possible to download custom sizes. It is indeed possible to do so just by specifying `w` and `h` in as query parameters (the predefined sized do the same). The api docs do not mention that though.
Proposed resolution
In the widget, add an option for `custum` as one of the Download sizes. If that is selected, show the width and height. Then generate the downlod url using that.
Remaining tasks
User interface changes

API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| Screenshot from 2024-11-26 11-43-30.png | 30.77 KB | primsi |
Issue fork media_pexels-3489842
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
primsi commentedIf this works fine, not sure if #3376719: Implement image resizing to save space makes sense any more.
Comment #4
berdirNo, it does not. But lets test this a bit, specifically with different aspect images of original images. The UI always calculates the other value from the one you change dynamically. We likely need to do this as well to get a valid size based on the original aspect ratio? we do not want to change that.
Do we have the width/height of the original image in the metadata?
I wrote this for the image_resize project: https://git.drupalcode.org/project/image_resize/-/blob/1.x/src/SizeCalcu...
we'll need to decide and define if the sizes you configure are upper or lower bound, meaning if it should be at least as big or not bigger than.
If the API handles that then great and this is fine.
Comment #5
primsi commentedSeems like
fit=maxbeing passed as one of the query arguments works fine if we want to ensure the image is inside the defined dimensions.Comment #7
primsi commentedRebased. Now merging this.
Thx.