Skip to content

"out of order read" when using extend with other option of extendWith #3928

@adityapatadia

Description

@adityapatadia

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.

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.

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

  System:
    OS: macOS 14.2.1
    CPU: (8) arm64 Apple M2
    Memory: 105.83 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.10.0 - /opt/homebrew/opt/node@20/bin/node
    npm: 10.2.3 - /opt/homebrew/opt/node@20/bin/npm
  npmPackages:
    sharp: 0.33.1 => 0.33.1

What are the steps to reproduce?

The image when processed with below code gives error.

What is the expected behaviour?

The code should not give error and actually extend image.

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

import sharp from 'sharp';
import Color from 'color';

async function process() {
    let transform = new sharp("horse.jpeg").extend({
        top: 200,
        right: 200,
        bottom: 200,
        left: 200,
        background: Color("#ffffff00"),
        extendWith: "mirror" // putting "background" works fine.
    })
    return transform.toFile("output.jpg");
}

process();

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

horse

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions