Upgrade to libvips v8.13.1

This commit is contained in:
Lovell Fuller 2022-09-04 12:42:27 +01:00
parent 1eb66c0944
commit 5cdb2b83d5
9 changed files with 25 additions and 26 deletions

View File

@ -2,7 +2,7 @@
## v0.31 - *eagle*
Requires libvips v8.13.0
Requires libvips v8.13.1
### v0.31.0 - TBD

View File

@ -123,7 +123,7 @@ const debuglog = util.debuglog('sharp');
* @param {number|boolean} [options.limitInputPixels=268402689] - Do not process input images where the number of pixels
* (width x height) exceeds this limit. Assumes image dimensions contained in the input metadata can be trusted.
* An integral Number of pixels, zero or false to remove limit, true to use default limit of 268402689 (0x3FFF x 0x3FFF).
* @param {boolean} [options.unlimited=false] - Set this to `true` to remove safety features that help prevent memory exhaustion (SVG, PNG).
* @param {boolean} [options.unlimited=false] - Set this to `true` to remove safety features that help prevent memory exhaustion (SVG, PNG, JPEG).
* @param {boolean} [options.sequentialRead=false] - Set this to `true` to use sequential rather than random access where possible.
* This can reduce memory usage and might improve performance on some systems.
* @param {number} [options.density=72] - number representing the DPI for vector images in the range 1 to 100000.

View File

@ -156,19 +156,19 @@
},
"license": "Apache-2.0",
"config": {
"libvips": "8.13.0",
"libvips": "8.13.1",
"integrity": {
"darwin-arm64v8": "sha512-Z0TzL+QuKrahXtBhpaVzGG66oxptywcLjCivIDdW49WZ0rtTeG4ZZ62V/QIrB1TXGnsV1byye9Mu79hvW5Wp9Q==",
"darwin-x64": "sha512-QsUByVM4HJMvpCpPU+WuUJziqpVP4A38wTtOPjzKT7gnLF9Tqme4RSDtnNqHmudUhJf4oNtuMdRJLglWiXR1+g==",
"linux-arm64v8": "sha512-IiEiQhwlAkpiBj74psXFM3a+BEP0lyWFrJ3QRhaYi29OY2fkYI9ZFxoRbRxUd7pCRb8aJIjnfMfrLWOfCMrR/w==",
"linux-armv6": "sha512-AQZHXqUtON9gFE0ScV6B63jcjo61om4atRRZBw8481ZNd6EsV1jWYl6PRjPiXD003l1qOGBLs9gOUnzXZK50+g==",
"linux-armv7": "sha512-RkLzvTxxezhrL6lhApwAUJ2mXDhmnG7d2dPzmqEQXBvyQxQYf840tiCuwawAuCuFgrSoYUKANeNvhGHIiYZ+Uw==",
"linux-x64": "sha512-HDSJU94GSXatsFXIy/kUQCiCSbH3jXTPQXeZ6Z9fc1dNy4t3FT+K72ijah4zHHdT2Epl3eOu6neGvtKHBwegDg==",
"linuxmusl-arm64v8": "sha512-zF1teyUYk4+IPUYkxay7KKaED4mDls/0SthimeMsxvGC96+8VvkSfG38QbYZveSGR/+1vNd7Z2zRmIBR9AcYoA==",
"linuxmusl-x64": "sha512-c4ZuAvIYm+rJYaK1fN/ZCJZz6DQ6gH7ra23ZHGCY0vFqx4EMDY7HjLumxBMHJhA/TklQkhpl4usWQyW4cStJHw==",
"win32-arm64v8": "sha512-QWTCYdi2Ci20J5f0bMuXwLsaluxzK9FqbgOJ2yw1z6fyg7DA3FUd7AuZPpCaFGDRlZGhQ6DtKB/6PNG2rK4jXQ==",
"win32-ia32": "sha512-ZYfF5k63bfViVxYy5OwjxApPZneIC/rir4DeXBmmop5AJ1pXdK2C8e2KDeM0DZtTioLjahoTAJ9shaM0dO8uAw==",
"win32-x64": "sha512-FpCX14SJ41sgriptgpukD+An/WsGK3ADwS5aZtHhJVxfg2lbdUBrO0bRd4KqLLa+/daZ19hOoHfKoNOpYSTKpw=="
"darwin-arm64v8": "sha512-JdpGTx67RDbvRkg3ljFvTzqoq+oBXmMdDFEp0expDYXmP5HLH+GCkikmsROlGltgfKE2KqL/qwpxTEhIwMK/3A==",
"darwin-x64": "sha512-0Oh4/hEDnzV+X8MiiyUQ4G/Zh/MHw9rKstfuX0P1czgaxS2hX8Pxdbzdk1oqwTOEYVEGO/hMm9ItCVZ3RVPPaA==",
"linux-arm64v8": "sha512-9pSlPzEojt6ue5vXfASNMhQO1YS1p4i4Wydu+bzOfMtIPSBRXbu/+y8WELbbo03Ts7pftm9KtrMHitCVdy5EXw==",
"linux-armv6": "sha512-sv2FqS/ggpQly7h5/+nh8txQDulolE5ptaE90PO7iwfTont8N42pudeqootWKsuf0fRmkW4M92184VfVVYCvGw==",
"linux-armv7": "sha512-LmQIB8FDfasK6BsFhnE7ZI3LMlxh/rF5tZRNQ/uoTbF2xrtWQqqgiZgCifJByiEM+1tR7RxwNdnjxZhWvM9WmQ==",
"linux-x64": "sha512-JBRf8WBnlVw/K1jpSvmeZpnGZGjeqhG2NDEiQV/hUze3zgDGwDza4oiworaQExQmKcDrc2LJKF14Nsz1qQSNJw==",
"linuxmusl-arm64v8": "sha512-yzUQO5isDwsRpEUxbMXBeWp0sKhWghebrSK46SUF5mvB/kq6hZ7JbRuJ2aZjE84K/HUTyuCc0kE+M3m8naOs+g==",
"linuxmusl-x64": "sha512-H3Vz1QaaZ6X5iEbfPST7TPFwDO01tI8dk1osLm6l4a17BWCaOMaBQlqxgTgYrtd09JJ9CvGoq5fo5j5TPxUc4Q==",
"win32-arm64v8": "sha512-b5Ver+uwOJhdOGqvZVM+qF2KLKcowcac/wKK5Fg0czqlSMqP/KxDF2kxw2eKXUJNgfqe4eDH1QG/yTg2pQSetQ==",
"win32-ia32": "sha512-h/SJ/Yfn0ce9H70vt1wS8rZ4PfHnguCCTsOGik7e6O/e2AlBQOM0mKsPIB9jSOquoCP8rP0qF6AOPOjXKnCk+w==",
"win32-x64": "sha512-p9qpdWdhZooPteib92Kk+qF1vvzcScxvOwdIP8muhgo/A8uDI4/mqXCpEbMBw6vjETKlS3qo2JUbVF6+0/lyWQ=="
},
"runtime": "napi",
"target": 7

View File

@ -164,7 +164,7 @@ namespace sharp {
descriptor->limitInputPixels = static_cast<uint64_t>(AttrAsInt64(input, "limitInputPixels"));
// Allow switch from random to sequential access
descriptor->access = AttrAsBool(input, "sequentialRead") ? VIPS_ACCESS_SEQUENTIAL : VIPS_ACCESS_RANDOM;
// Remove safety features and allow unlimited SVG/PNG input
// Remove safety features and allow unlimited SVG/PNG/JPEG input
descriptor->unlimited = AttrAsBool(input, "unlimited");
return descriptor;
}
@ -362,7 +362,8 @@ namespace sharp {
vips::VOption *option = VImage::option()
->set("access", descriptor->access)
->set("fail_on", descriptor->failOn);
if (descriptor->unlimited && (imageType == ImageType::SVG || imageType == ImageType::PNG)) {
if (descriptor->unlimited &&
(imageType == ImageType::SVG || imageType == ImageType::PNG || imageType == ImageType::JPEG)) {
option->set("unlimited", TRUE);
}
if (imageType == ImageType::SVG || imageType == ImageType::PDF) {
@ -465,7 +466,8 @@ namespace sharp {
vips::VOption *option = VImage::option()
->set("access", descriptor->access)
->set("fail_on", descriptor->failOn);
if (descriptor->unlimited && (imageType == ImageType::SVG || imageType == ImageType::PNG)) {
if (descriptor->unlimited &&
(imageType == ImageType::SVG || imageType == ImageType::PNG || imageType == ImageType::JPEG)) {
option->set("unlimited", TRUE);
}
if (imageType == ImageType::SVG || imageType == ImageType::PDF) {

View File

@ -26,8 +26,8 @@
#if (VIPS_MAJOR_VERSION < 8) || \
(VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION < 13) || \
(VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION == 13 && VIPS_MICRO_VERSION < 0)
#error "libvips version 8.13.0+ is required - please see https://sharp.pixelplumbing.com/install"
(VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION == 13 && VIPS_MICRO_VERSION < 1)
#error "libvips version 8.13.1+ is required - please see https://sharp.pixelplumbing.com/install"
#endif
#if ((!defined(__clang__)) && defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6)))

View File

@ -204,6 +204,7 @@ class PipelineWorker : public Napi::AsyncWorker {
vips::VOption *option = VImage::option()
->set("access", baton->input->access)
->set("shrink", jpegShrinkOnLoad)
->set("unlimited", baton->input->unlimited)
->set("fail_on", baton->input->failOn);
if (baton->input->buffer != nullptr) {
// Reload JPEG buffer

View File

@ -72,11 +72,7 @@ describe('AVIF', () => {
format: 'heif',
hasAlpha: false,
hasProfile: false,
// FIXME(kleisauke): https://github.com/strukturag/libheif/issues/365
// $ vips black x.avif 32 13
// $ vipsheader x.avif
// x.avif: 32x12 uchar, 3 bands, srgb, heifload
height: 12,
height: 13,
isProgressive: false,
pagePrimary: 0,
pages: 1,

View File

@ -680,7 +680,7 @@ describe('Input/output', function () {
});
});
describe('Switch off safety limits for PNG/SVG input', () => {
describe('Switch off safety limits for PNG/SVG/JPEG input', () => {
it('Valid', () => {
assert.doesNotThrow(() => {
sharp({ unlimited: true });

View File

@ -203,7 +203,7 @@ describe('PNG', function () {
const { channels, paletteBitDepth, size, space } = await sharp(data).metadata();
assert.strictEqual(channels, 1);
assert.strictEqual(paletteBitDepth, undefined);
assert.strictEqual(size, 90);
assert.strictEqual(size, 89);
assert.strictEqual(space, 'b-w');
});