mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 18:40:16 +02:00
Upgrade to libvips v8.13.1
This commit is contained in:
parent
1eb66c0944
commit
5cdb2b83d5
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
## v0.31 - *eagle*
|
## v0.31 - *eagle*
|
||||||
|
|
||||||
Requires libvips v8.13.0
|
Requires libvips v8.13.1
|
||||||
|
|
||||||
### v0.31.0 - TBD
|
### v0.31.0 - TBD
|
||||||
|
|
||||||
|
@ -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
|
* @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.
|
* (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).
|
* 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.
|
* @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.
|
* 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.
|
* @param {number} [options.density=72] - number representing the DPI for vector images in the range 1 to 100000.
|
||||||
|
24
package.json
24
package.json
@ -156,19 +156,19 @@
|
|||||||
},
|
},
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"config": {
|
"config": {
|
||||||
"libvips": "8.13.0",
|
"libvips": "8.13.1",
|
||||||
"integrity": {
|
"integrity": {
|
||||||
"darwin-arm64v8": "sha512-Z0TzL+QuKrahXtBhpaVzGG66oxptywcLjCivIDdW49WZ0rtTeG4ZZ62V/QIrB1TXGnsV1byye9Mu79hvW5Wp9Q==",
|
"darwin-arm64v8": "sha512-JdpGTx67RDbvRkg3ljFvTzqoq+oBXmMdDFEp0expDYXmP5HLH+GCkikmsROlGltgfKE2KqL/qwpxTEhIwMK/3A==",
|
||||||
"darwin-x64": "sha512-QsUByVM4HJMvpCpPU+WuUJziqpVP4A38wTtOPjzKT7gnLF9Tqme4RSDtnNqHmudUhJf4oNtuMdRJLglWiXR1+g==",
|
"darwin-x64": "sha512-0Oh4/hEDnzV+X8MiiyUQ4G/Zh/MHw9rKstfuX0P1czgaxS2hX8Pxdbzdk1oqwTOEYVEGO/hMm9ItCVZ3RVPPaA==",
|
||||||
"linux-arm64v8": "sha512-IiEiQhwlAkpiBj74psXFM3a+BEP0lyWFrJ3QRhaYi29OY2fkYI9ZFxoRbRxUd7pCRb8aJIjnfMfrLWOfCMrR/w==",
|
"linux-arm64v8": "sha512-9pSlPzEojt6ue5vXfASNMhQO1YS1p4i4Wydu+bzOfMtIPSBRXbu/+y8WELbbo03Ts7pftm9KtrMHitCVdy5EXw==",
|
||||||
"linux-armv6": "sha512-AQZHXqUtON9gFE0ScV6B63jcjo61om4atRRZBw8481ZNd6EsV1jWYl6PRjPiXD003l1qOGBLs9gOUnzXZK50+g==",
|
"linux-armv6": "sha512-sv2FqS/ggpQly7h5/+nh8txQDulolE5ptaE90PO7iwfTont8N42pudeqootWKsuf0fRmkW4M92184VfVVYCvGw==",
|
||||||
"linux-armv7": "sha512-RkLzvTxxezhrL6lhApwAUJ2mXDhmnG7d2dPzmqEQXBvyQxQYf840tiCuwawAuCuFgrSoYUKANeNvhGHIiYZ+Uw==",
|
"linux-armv7": "sha512-LmQIB8FDfasK6BsFhnE7ZI3LMlxh/rF5tZRNQ/uoTbF2xrtWQqqgiZgCifJByiEM+1tR7RxwNdnjxZhWvM9WmQ==",
|
||||||
"linux-x64": "sha512-HDSJU94GSXatsFXIy/kUQCiCSbH3jXTPQXeZ6Z9fc1dNy4t3FT+K72ijah4zHHdT2Epl3eOu6neGvtKHBwegDg==",
|
"linux-x64": "sha512-JBRf8WBnlVw/K1jpSvmeZpnGZGjeqhG2NDEiQV/hUze3zgDGwDza4oiworaQExQmKcDrc2LJKF14Nsz1qQSNJw==",
|
||||||
"linuxmusl-arm64v8": "sha512-zF1teyUYk4+IPUYkxay7KKaED4mDls/0SthimeMsxvGC96+8VvkSfG38QbYZveSGR/+1vNd7Z2zRmIBR9AcYoA==",
|
"linuxmusl-arm64v8": "sha512-yzUQO5isDwsRpEUxbMXBeWp0sKhWghebrSK46SUF5mvB/kq6hZ7JbRuJ2aZjE84K/HUTyuCc0kE+M3m8naOs+g==",
|
||||||
"linuxmusl-x64": "sha512-c4ZuAvIYm+rJYaK1fN/ZCJZz6DQ6gH7ra23ZHGCY0vFqx4EMDY7HjLumxBMHJhA/TklQkhpl4usWQyW4cStJHw==",
|
"linuxmusl-x64": "sha512-H3Vz1QaaZ6X5iEbfPST7TPFwDO01tI8dk1osLm6l4a17BWCaOMaBQlqxgTgYrtd09JJ9CvGoq5fo5j5TPxUc4Q==",
|
||||||
"win32-arm64v8": "sha512-QWTCYdi2Ci20J5f0bMuXwLsaluxzK9FqbgOJ2yw1z6fyg7DA3FUd7AuZPpCaFGDRlZGhQ6DtKB/6PNG2rK4jXQ==",
|
"win32-arm64v8": "sha512-b5Ver+uwOJhdOGqvZVM+qF2KLKcowcac/wKK5Fg0czqlSMqP/KxDF2kxw2eKXUJNgfqe4eDH1QG/yTg2pQSetQ==",
|
||||||
"win32-ia32": "sha512-ZYfF5k63bfViVxYy5OwjxApPZneIC/rir4DeXBmmop5AJ1pXdK2C8e2KDeM0DZtTioLjahoTAJ9shaM0dO8uAw==",
|
"win32-ia32": "sha512-h/SJ/Yfn0ce9H70vt1wS8rZ4PfHnguCCTsOGik7e6O/e2AlBQOM0mKsPIB9jSOquoCP8rP0qF6AOPOjXKnCk+w==",
|
||||||
"win32-x64": "sha512-FpCX14SJ41sgriptgpukD+An/WsGK3ADwS5aZtHhJVxfg2lbdUBrO0bRd4KqLLa+/daZ19hOoHfKoNOpYSTKpw=="
|
"win32-x64": "sha512-p9qpdWdhZooPteib92Kk+qF1vvzcScxvOwdIP8muhgo/A8uDI4/mqXCpEbMBw6vjETKlS3qo2JUbVF6+0/lyWQ=="
|
||||||
},
|
},
|
||||||
"runtime": "napi",
|
"runtime": "napi",
|
||||||
"target": 7
|
"target": 7
|
||||||
|
@ -164,7 +164,7 @@ namespace sharp {
|
|||||||
descriptor->limitInputPixels = static_cast<uint64_t>(AttrAsInt64(input, "limitInputPixels"));
|
descriptor->limitInputPixels = static_cast<uint64_t>(AttrAsInt64(input, "limitInputPixels"));
|
||||||
// Allow switch from random to sequential access
|
// Allow switch from random to sequential access
|
||||||
descriptor->access = AttrAsBool(input, "sequentialRead") ? VIPS_ACCESS_SEQUENTIAL : VIPS_ACCESS_RANDOM;
|
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");
|
descriptor->unlimited = AttrAsBool(input, "unlimited");
|
||||||
return descriptor;
|
return descriptor;
|
||||||
}
|
}
|
||||||
@ -362,7 +362,8 @@ namespace sharp {
|
|||||||
vips::VOption *option = VImage::option()
|
vips::VOption *option = VImage::option()
|
||||||
->set("access", descriptor->access)
|
->set("access", descriptor->access)
|
||||||
->set("fail_on", descriptor->failOn);
|
->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);
|
option->set("unlimited", TRUE);
|
||||||
}
|
}
|
||||||
if (imageType == ImageType::SVG || imageType == ImageType::PDF) {
|
if (imageType == ImageType::SVG || imageType == ImageType::PDF) {
|
||||||
@ -465,7 +466,8 @@ namespace sharp {
|
|||||||
vips::VOption *option = VImage::option()
|
vips::VOption *option = VImage::option()
|
||||||
->set("access", descriptor->access)
|
->set("access", descriptor->access)
|
||||||
->set("fail_on", descriptor->failOn);
|
->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);
|
option->set("unlimited", TRUE);
|
||||||
}
|
}
|
||||||
if (imageType == ImageType::SVG || imageType == ImageType::PDF) {
|
if (imageType == ImageType::SVG || imageType == ImageType::PDF) {
|
||||||
|
@ -26,8 +26,8 @@
|
|||||||
|
|
||||||
#if (VIPS_MAJOR_VERSION < 8) || \
|
#if (VIPS_MAJOR_VERSION < 8) || \
|
||||||
(VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION < 13) || \
|
(VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION < 13) || \
|
||||||
(VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION == 13 && VIPS_MICRO_VERSION < 0)
|
(VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION == 13 && VIPS_MICRO_VERSION < 1)
|
||||||
#error "libvips version 8.13.0+ is required - please see https://sharp.pixelplumbing.com/install"
|
#error "libvips version 8.13.1+ is required - please see https://sharp.pixelplumbing.com/install"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ((!defined(__clang__)) && defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6)))
|
#if ((!defined(__clang__)) && defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6)))
|
||||||
|
@ -204,6 +204,7 @@ class PipelineWorker : public Napi::AsyncWorker {
|
|||||||
vips::VOption *option = VImage::option()
|
vips::VOption *option = VImage::option()
|
||||||
->set("access", baton->input->access)
|
->set("access", baton->input->access)
|
||||||
->set("shrink", jpegShrinkOnLoad)
|
->set("shrink", jpegShrinkOnLoad)
|
||||||
|
->set("unlimited", baton->input->unlimited)
|
||||||
->set("fail_on", baton->input->failOn);
|
->set("fail_on", baton->input->failOn);
|
||||||
if (baton->input->buffer != nullptr) {
|
if (baton->input->buffer != nullptr) {
|
||||||
// Reload JPEG buffer
|
// Reload JPEG buffer
|
||||||
|
@ -72,11 +72,7 @@ describe('AVIF', () => {
|
|||||||
format: 'heif',
|
format: 'heif',
|
||||||
hasAlpha: false,
|
hasAlpha: false,
|
||||||
hasProfile: false,
|
hasProfile: false,
|
||||||
// FIXME(kleisauke): https://github.com/strukturag/libheif/issues/365
|
height: 13,
|
||||||
// $ vips black x.avif 32 13
|
|
||||||
// $ vipsheader x.avif
|
|
||||||
// x.avif: 32x12 uchar, 3 bands, srgb, heifload
|
|
||||||
height: 12,
|
|
||||||
isProgressive: false,
|
isProgressive: false,
|
||||||
pagePrimary: 0,
|
pagePrimary: 0,
|
||||||
pages: 1,
|
pages: 1,
|
||||||
|
@ -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', () => {
|
it('Valid', () => {
|
||||||
assert.doesNotThrow(() => {
|
assert.doesNotThrow(() => {
|
||||||
sharp({ unlimited: true });
|
sharp({ unlimited: true });
|
||||||
|
@ -203,7 +203,7 @@ describe('PNG', function () {
|
|||||||
const { channels, paletteBitDepth, size, space } = await sharp(data).metadata();
|
const { channels, paletteBitDepth, size, space } = await sharp(data).metadata();
|
||||||
assert.strictEqual(channels, 1);
|
assert.strictEqual(channels, 1);
|
||||||
assert.strictEqual(paletteBitDepth, undefined);
|
assert.strictEqual(paletteBitDepth, undefined);
|
||||||
assert.strictEqual(size, 90);
|
assert.strictEqual(size, 89);
|
||||||
assert.strictEqual(space, 'b-w');
|
assert.strictEqual(space, 'b-w');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user