diff --git a/docs/changelog.md b/docs/changelog.md index b27ecaec..4353953d 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -2,7 +2,7 @@ ## v0.31 - *eagle* -Requires libvips v8.13.0 +Requires libvips v8.13.1 ### v0.31.0 - TBD diff --git a/lib/constructor.js b/lib/constructor.js index 25a4e02b..645eecc6 100644 --- a/lib/constructor.js +++ b/lib/constructor.js @@ -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. diff --git a/package.json b/package.json index 586a953b..10ae6d05 100644 --- a/package.json +++ b/package.json @@ -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 diff --git a/src/common.cc b/src/common.cc index 46b439f2..9781bcde 100644 --- a/src/common.cc +++ b/src/common.cc @@ -164,7 +164,7 @@ namespace sharp { descriptor->limitInputPixels = static_cast(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) { diff --git a/src/common.h b/src/common.h index e2f12fbd..ab6b5850 100644 --- a/src/common.h +++ b/src/common.h @@ -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))) diff --git a/src/pipeline.cc b/src/pipeline.cc index 361b509e..db52063d 100644 --- a/src/pipeline.cc +++ b/src/pipeline.cc @@ -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 diff --git a/test/unit/avif.js b/test/unit/avif.js index 1714460e..9a17f723 100644 --- a/test/unit/avif.js +++ b/test/unit/avif.js @@ -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, diff --git a/test/unit/io.js b/test/unit/io.js index dd8199be..2259bf15 100644 --- a/test/unit/io.js +++ b/test/unit/io.js @@ -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 }); diff --git a/test/unit/png.js b/test/unit/png.js index b3bf4fc1..bda0d098 100644 --- a/test/unit/png.js +++ b/test/unit/png.js @@ -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'); });