Skip to content

Commit

Permalink
Ignore sequentialRead option for stats #3462
Browse files Browse the repository at this point in the history
  • Loading branch information
lovell committed Nov 20, 2022
1 parent 01ffa80 commit a472aea
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/changelog.md
Expand Up @@ -15,6 +15,9 @@ Requires libvips v8.13.3
* Improve `extractChannel` support for 16-bit output colourspaces.
[#3453](https://github.com/lovell/sharp/issues/3453)

* Ignore `sequentialRead` option when calculating image statistics.
[#3462](https://github.com/lovell/sharp/issues/3462)

### v0.31.2 - 4th November 2022

* Upgrade to libvips v8.13.3 for upstream bug fixes.
Expand Down
1 change: 1 addition & 0 deletions src/stats.cc
Expand Up @@ -176,6 +176,7 @@ Napi::Value stats(const Napi::CallbackInfo& info) {

// Input
baton->input = sharp::CreateInputDescriptor(options.Get("input").As<Napi::Object>());
baton->input->access = VIPS_ACCESS_RANDOM;

// Function to notify of libvips warnings
Napi::Function debuglog = options.Get("debuglog").As<Napi::Function>();
Expand Down
5 changes: 5 additions & 0 deletions test/unit/stats.js
Expand Up @@ -730,4 +730,9 @@ describe('Image Stats', function () {
done();
});
});

it('Sequential read option is ignored', async () => {
const { isOpaque } = await sharp(fixtures.inputJpg, { sequentialRead: true }).stats();
assert.strictEqual(isOpaque, true);
});
});

0 comments on commit a472aea

Please sign in to comment.