Skip to content

Tiled composition onto resized image using fit=outside fails #3227

@faradaytrs

Description

@faradaytrs

Possible bug

Is this a possible bug in a feature of sharp, unrelated to installation?

  • Running npm install sharp completes without error.
  • Running node -e "require('sharp')" completes without error.

If you cannot confirm both of these, please open an installation issue instead.

Are you using the latest version of sharp?

  • I am using the latest version of sharp as reported by npm view sharp dist-tags.latest.

If you cannot confirm this, please upgrade to the latest version and try again before opening an issue.

If you are using another package which depends on a version of sharp that is not the latest, please open an issue against that package instead.

What is the output of running npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp?

Cannot provide output because it happens in AWS lambda environment with node16 runtime. 1024mb memory.

What are the steps to reproduce?

I try to resize image and add watermark, watermark is resized before composing.

  1. First resize first image with: { width: 5000, height: 250, withoutEnlargement: true, fit: 'outside' }'
    fit=inside works fine.
  2. Resize second image (watermark) with { height: 768 }
  3. Compose them:
    {
    input: await secondImage.toBuffer(),
    tile: true,
    },
    And then i have the following error:
    (process:9): GLib-GObject-WARNING **: 03:40:16.528: value "0" of type 'gint' is invalid or out of range for property 'down' of type 'gint'
    ERROR Invoke Error {"errorType":"Error","errorMessage":"replicate: parameter down not set\n","stack":["Error: replicate: parameter down not set",""]}

What is the expected behaviour?

Expected to successfully generate image with watermark.

Please provide a minimal, standalone code sample, without other dependencies, that demonstrates this problem

Please provide sample image(s) that help explain this problem

first image
watermark

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions