mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 18:40:16 +02:00
Add support for libvips v8.0.0
This commit is contained in:
parent
5194b37460
commit
f89e9d726d
@ -2,7 +2,7 @@
|
|||||||
"strict": true,
|
"strict": true,
|
||||||
"node": true,
|
"node": true,
|
||||||
"maxparams": 4,
|
"maxparams": 4,
|
||||||
"maxcomplexity": 11,
|
"maxcomplexity": 13,
|
||||||
"globals": {
|
"globals": {
|
||||||
"describe": true,
|
"describe": true,
|
||||||
"it": true
|
"it": true
|
||||||
|
@ -86,7 +86,7 @@ namespace sharp {
|
|||||||
vips_webpload_buffer(buffer, length, &image, "access", access, NULL);
|
vips_webpload_buffer(buffer, length, &image, "access", access, NULL);
|
||||||
} else if (imageType == ImageType::TIFF) {
|
} else if (imageType == ImageType::TIFF) {
|
||||||
vips_tiffload_buffer(buffer, length, &image, "access", access, NULL);
|
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) {
|
} else if (imageType == ImageType::MAGICK) {
|
||||||
vips_magickload_buffer(buffer, length, &image, "access", access, NULL);
|
vips_magickload_buffer(buffer, length, &image, "access", access, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
@ -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+
|
// Generate image tile cache when interlace output is required - no longer required as of libvips 7.40.5+
|
||||||
if (baton->progressive) {
|
if (baton->progressive) {
|
||||||
VipsImage *cached;
|
VipsImage *cached;
|
||||||
@ -683,7 +683,7 @@ class ResizeWorker : public NanAsyncWorker {
|
|||||||
}
|
}
|
||||||
baton->outputFormat = "jpeg";
|
baton->outputFormat = "jpeg";
|
||||||
} else if (baton->output == "__png" || (baton->output == "__input" && inputImageType == ImageType::PNG)) {
|
} 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
|
// Select PNG row filter
|
||||||
int filter = baton->withoutAdaptiveFiltering ? VIPS_FOREIGN_PNG_FILTER_NONE : VIPS_FOREIGN_PNG_FILTER_ALL;
|
int filter = baton->withoutAdaptiveFiltering ? VIPS_FOREIGN_PNG_FILTER_NONE : VIPS_FOREIGN_PNG_FILTER_ALL;
|
||||||
// Write PNG to buffer
|
// Write PNG to buffer
|
||||||
@ -706,7 +706,7 @@ class ResizeWorker : public NanAsyncWorker {
|
|||||||
return Error(baton, hook);
|
return Error(baton, hook);
|
||||||
}
|
}
|
||||||
baton->outputFormat = "webp";
|
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") {
|
} else if (baton->output == "__raw") {
|
||||||
// Write raw, uncompressed image data to buffer
|
// Write raw, uncompressed image data to buffer
|
||||||
if (baton->greyscale) {
|
if (baton->greyscale) {
|
||||||
@ -750,7 +750,7 @@ class ResizeWorker : public NanAsyncWorker {
|
|||||||
}
|
}
|
||||||
baton->outputFormat = "jpeg";
|
baton->outputFormat = "jpeg";
|
||||||
} else if (outputPng || (matchInput && inputImageType == ImageType::PNG)) {
|
} 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
|
// Select PNG row filter
|
||||||
int filter = baton->withoutAdaptiveFiltering ? VIPS_FOREIGN_PNG_FILTER_NONE : VIPS_FOREIGN_PNG_FILTER_ALL;
|
int filter = baton->withoutAdaptiveFiltering ? VIPS_FOREIGN_PNG_FILTER_NONE : VIPS_FOREIGN_PNG_FILTER_ALL;
|
||||||
// Write PNG to file
|
// Write PNG to file
|
||||||
|
Loading…
x
Reference in New Issue
Block a user