From f89e9d726d9c6ee99e8e7cf0220b8da6b90cd83d Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Mon, 16 Feb 2015 13:27:22 +0000 Subject: [PATCH] Add support for libvips v8.0.0 --- .jshintrc | 2 +- src/common.cc | 2 +- src/resize.cc | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.jshintrc b/.jshintrc index b95ee9fd..4e909da6 100644 --- a/.jshintrc +++ b/.jshintrc @@ -2,7 +2,7 @@ "strict": true, "node": true, "maxparams": 4, - "maxcomplexity": 11, + "maxcomplexity": 13, "globals": { "describe": true, "it": true diff --git a/src/common.cc b/src/common.cc index 19f96ed2..ea690bbc 100755 --- a/src/common.cc +++ b/src/common.cc @@ -86,7 +86,7 @@ namespace sharp { vips_webpload_buffer(buffer, length, &image, "access", access, NULL); } else if (imageType == ImageType::TIFF) { vips_tiffload_buffer(buffer, length, &image, "access", access, NULL); -#if (VIPS_MAJOR_VERSION >= 8 && VIPS_MINOR_VERSION >= 0) +#if (VIPS_MAJOR_VERSION >= 8) } else if (imageType == ImageType::MAGICK) { vips_magickload_buffer(buffer, length, &image, "access", access, NULL); #endif diff --git a/src/resize.cc b/src/resize.cc index 175b136e..380a2227 100755 --- a/src/resize.cc +++ b/src/resize.cc @@ -661,7 +661,7 @@ class ResizeWorker : public NanAsyncWorker { } } -#if !(VIPS_MAJOR_VERSION >= 7 && VIPS_MINOR_VERSION >= 40 && VIPS_MINOR_VERSION >= 5) +#if !(VIPS_MAJOR_VERSION >= 8 || (VIPS_MAJOR_VERSION >= 7 && VIPS_MINOR_VERSION >= 40 && VIPS_MINOR_VERSION >= 5)) // Generate image tile cache when interlace output is required - no longer required as of libvips 7.40.5+ if (baton->progressive) { VipsImage *cached; @@ -683,7 +683,7 @@ class ResizeWorker : public NanAsyncWorker { } baton->outputFormat = "jpeg"; } else if (baton->output == "__png" || (baton->output == "__input" && inputImageType == ImageType::PNG)) { -#if (VIPS_MAJOR_VERSION >= 7 && VIPS_MINOR_VERSION >= 42) +#if (VIPS_MAJOR_VERSION >= 8 || (VIPS_MAJOR_VERSION >= 7 && VIPS_MINOR_VERSION >= 42)) // Select PNG row filter int filter = baton->withoutAdaptiveFiltering ? VIPS_FOREIGN_PNG_FILTER_NONE : VIPS_FOREIGN_PNG_FILTER_ALL; // Write PNG to buffer @@ -706,7 +706,7 @@ class ResizeWorker : public NanAsyncWorker { return Error(baton, hook); } baton->outputFormat = "webp"; -#if (VIPS_MAJOR_VERSION >= 7 && VIPS_MINOR_VERSION >= 42) +#if (VIPS_MAJOR_VERSION >= 8 || (VIPS_MAJOR_VERSION >= 7 && VIPS_MINOR_VERSION >= 42)) } else if (baton->output == "__raw") { // Write raw, uncompressed image data to buffer if (baton->greyscale) { @@ -750,7 +750,7 @@ class ResizeWorker : public NanAsyncWorker { } baton->outputFormat = "jpeg"; } else if (outputPng || (matchInput && inputImageType == ImageType::PNG)) { -#if (VIPS_MAJOR_VERSION >= 7 && VIPS_MINOR_VERSION >= 42) +#if (VIPS_MAJOR_VERSION >= 8 || (VIPS_MAJOR_VERSION >= 7 && VIPS_MINOR_VERSION >= 42)) // Select PNG row filter int filter = baton->withoutAdaptiveFiltering ? VIPS_FOREIGN_PNG_FILTER_NONE : VIPS_FOREIGN_PNG_FILTER_ALL; // Write PNG to file