Skip to content

withoutEnlargement #4

@bronewi4ok

Description

@bronewi4ok

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions