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

Sharp fit #146

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

seb-celinedesign
Copy link

Add the new Sharp fit parameter as a configuration option. Replace the deprecated max parameter.

@StarpTech
Copy link
Collaborator

Hi @CelineDesign, could you add a test?

@seb-celinedesign
Copy link
Author

Hi, just add the fit option in the config object and a test for it.
Is that what you wanted ?

@StarpTech
Copy link
Collaborator

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'
Copy link
Collaborator

@StarpTech StarpTech Jun 7, 2020

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.

Copy link
Author

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.

@seb-celinedesign
Copy link
Author

seb-celinedesign commented Jun 8, 2020

I mean a test that guarantees the correct output.

By "correct output" do you mean the file at the right dimension ?
Because none of the current test is testing the generated image file and his properties. I think the role of gulp-responsive is to pass correct params to the Sharp library, which is the one who manipulate image files.

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