New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image Resizer Improvements - specify maxWidth/maxHeight #24900
Comments
NOTE TO QA:Based on the rules stated by Will in the ticket's description:
Here are some tests scenarios that can be used to verify that the new resizing options are working as expected: -> Testing image with
|
Fixed, tested on master // docker // FF Tested each escenario and now we are able to send and set the filters without problems. |
Parent Issue
No response
User Story
As a site builder, often when I am resizing images, what I am looking to do is actually just specify a maxWidth and/or a maxHeight.
Take resizing phone images for example. You can have images that are portraits (vertical) and images that are landscape (horizontal) - right now, in dotCMS you might specify a width to resize these images which might shrink landscaped images larger than that width but might also have the negative side effect of enlarging portrait images to the specified width. In practice, you almost never want to enlarge images that are narrower than your specified width. This is where a
maxWidth
would come in - it would act as a constraining box that would shrink images larger than that width to themaxWidth
but would leave images smaller than that width alone. Same withmaxHeight
If you specified both a
maxWidth
and amaxHeight
, it would in essence act as a constraining box and shrink any images larger than the maxWidth/maxHeight proportionally and leave images smaller than that alone. When you couple this with a wrapping div, having this would allow you to build a nice thumbnail gallery that does not force images smaller than it to grow (like our thumbnailer, but without the additional whitespace added to the image) like this:Acceptance Criteria
Maintain all current resizing functionality.
Example image urls:
/da Pathing
http://127.0.0.1:8080/dA/84e8159f-0e66-4970-9098-79f4e7e24686/image1/1000minh
http://127.0.0.1:8080/dA/84e8159f-0e66-4970-9098-79f4e7e24686/image1/500minw
http://127.0.0.1:8080/dA/84e8159f-0e66-4970-9098-79f4e7e24686/image1/200maxh
http://127.0.0.1:8080/dA/84e8159f-0e66-4970-9098-79f4e7e24686/image1/200maxw
long form pathing
http://127.0.0.1:8080/contentAsset/image/84e8159f-0e66-4970-9098-79f4e7e24686/image/resize_minh/1000
http://127.0.0.1:8080/contentAsset/image/84e8159f-0e66-4970-9098-79f4e7e24686/image/resize_maxh/100
http://127.0.0.1:8080/contentAsset/image/84e8159f-0e66-4970-9098-79f4e7e24686/image/resize_maxw/100
http://127.0.0.1:8080/contentAsset/image/84e8159f-0e66-4970-9098-79f4e7e24686/image/resize_minw/200
width
orheight
specified, respect it firstmaxw
and/ormaxh
formax
image resizing, respect them secondminw
and/orminh
respect them last.These cannot be combined.
The text was updated successfully, but these errors were encountered: