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

.stats() fails if sequentialRead is true #3462

Closed
3 tasks done
ssendev opened this issue Nov 20, 2022 · 2 comments
Closed
3 tasks done

.stats() fails if sequentialRead is true #3462

ssendev opened this issue Nov 20, 2022 · 2 comments

Comments

@ssendev
Copy link

ssendev commented Nov 20, 2022

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?

  System:
    OS: Linux 5.19 Fedora Linux 36 (Workstation Edition)
    CPU: (8) x64 Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz
    Memory: 16.72 GB / 31.07 GB
    Container: Yes
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.9.0 - ~/.nvm/versions/node/v18.9.0/bin/node
    Yarn: 1.22.19 - /usr/bin/yarn
    npm: 8.19.1 - ~/.nvm/versions/node/v18.9.0/bin/npm
  npmPackages:
    sharp: ^0.31.2 => 0.31.2 

What are the steps to reproduce?

Use sequentialRead: true and .stats() together which results in Uncaught Error: VipsJpeg: out of order read at line 1776 or Uncaught Error: pngload: out of order read at line 2048

What is the expected behaviour?

The docs for sequentialRead say used where possible so i would expect it silently ignoring the option alternatively an error message that the two are incompatible might also be a solution.

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

await require('sharp')('img.jpg',{ sequentialRead: true }).stats()
@ssendev ssendev added the triage label Nov 20, 2022
@lovell lovell added this to the v0.31.3 milestone Nov 20, 2022
@lovell
Copy link
Owner

lovell commented Nov 20, 2022

Good catch, thanks for reporting, commit a472aea fixes this and adds a test.

@lovell
Copy link
Owner

lovell commented Dec 21, 2022

v0.31.3 now available, thanks again for reporting.

@lovell lovell closed this as completed Dec 21, 2022
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