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

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

Closed
3 tasks done
adityapatadia opened this issue Jan 3, 2024 · 2 comments
Closed
3 tasks done

Comments

@adityapatadia
Copy link

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

@lovell
Copy link
Owner

lovell commented Jan 4, 2024

Thanks for reporting, commit 9bcf399 fixes this and adds a test case.

A possible workaround for now is sharp(input, { sequentialRead: false })...

@lovell
Copy link
Owner

lovell commented Jan 12, 2024

v0.33.2 now available with the fix.

@lovell lovell closed this as completed Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants