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

withoutEnlargement #4

Open
bronewi4ok opened this issue Jan 27, 2022 · 0 comments
Open

withoutEnlargement #4

bronewi4ok opened this issue Jan 27, 2022 · 0 comments

Comments

@bronewi4ok
Copy link

bronewi4ok commented Jan 27, 2022

Hi! Could you please help me to add this sharp option (https://sharp.pixelplumbing.com/api-resize#parameters):
options.withoutEnlargement Boolean do not enlarge if the width or height are already less than the specified dimensions, equivalent to GraphicsMagick's > geometry option. (optional, default false)

Is it possible?
I have tried different variants that are not working:

    .pipe(sharpResponsive({
      includeOriginalFile: true,
      withoutEnlargement: true,
      formats: [
        { width: 768, sharp: { withoutEnlargement: true }, withoutEnlargement: true, quality: 100, rename: { suffix: "_mq2" } },
      ]
    }))

The original image (3kb) is enlarged to 1202kb

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

No branches or pull requests

1 participant