Ignore sequentialRead option for stats #3462

This commit is contained in:
Lovell Fuller 2022-11-20 21:30:45 +00:00
parent 01ffa80338
commit a472aea025
3 changed files with 9 additions and 0 deletions

View File

@ -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.

View File

@ -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>();

View File

@ -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);
});
});