-
Notifications
You must be signed in to change notification settings - Fork 60
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
Sharp fit #146
base: master
Are you sure you want to change the base?
Sharp fit #146
Conversation
Hi @CelineDesign, could you add a test? |
Hi, just add the fit option in the config object and a test for it. |
I mean a test that guarantees the correct output. |
@@ -85,7 +85,8 @@ const defaultConfig = { | |||
withoutChromaSubsampling: false, | |||
compressionLevel: 6, | |||
format: null, | |||
trim: false | |||
trim: false, | |||
fit: 'cover' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default option is centre
https://sharp.pixelplumbing.com/api-resize#resize that change would be breaking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're mistaking. According to the documentation the "fit" parameter default value is "cover". See here :
https://sharp.pixelplumbing.com/api-resize#resize
Centre is the "position" param default value.
By "correct output" do you mean the file at the right dimension ? |
Add the new Sharp fit parameter as a configuration option. Replace the deprecated max parameter.