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

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