Skip to content
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

Accept mode param in image size definition #5

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

lucaslopez
Copy link

This modification adds the possibility to add a new parameter in the images size definition: mode.

If mode = 'cropCenter', the image will be cropped to match the specified dimensions, no matter the original aspect ratio.
If not specified the default behavior will be applied.

This is handy if you need to have different aspect ratios in the same image, by cropping them centered. If the image is smaller than the required dimensions, it will be amplified.

For instance:

addImageSizes:
[
{
name: 'listado-1',
mode: 'cropCenter',
width: 440,
height: 250
}
]

This modification adds the possibility to add a new parameter in the images size definition: mode.

If mode = 'cropCenter', the image will be cropped to match the specified dimensions, no matter the original aspect ratio.
If not specified the default behavior will be applied.

This is handy if you need to have different aspect ratios in the same image, by cropping them centered. If the image is smaller than the required dimensions, it will be amplified.
@abea
Copy link
Contributor

abea commented May 12, 2020

Please include documentation of the new option and passing tests if you are still interested in this feature. I realize we're criminally late responding. Sorry for the delay!

@abea abea changed the base branch from master to main August 5, 2020 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants