Upgrade to libvips 8.15.0-rc2

This commit is contained in:
Lovell Fuller 2023-11-04 09:22:58 +00:00
parent 7caaa8e22b
commit 2e7c60675b
18 changed files with 35 additions and 63 deletions

View File

@ -1,6 +1,6 @@
{ {
"runtime": "napi", "runtime": "napi",
"include-regex": "(sharp-.+\\.node|libvips-.+\\.dll|libglib-.+\\.dll|libgobject-.+\\.dll)", "include-regex": "(sharp-.+\\.node|libvips-.+\\.dll)",
"prerelease": true, "prerelease": true,
"strip": true "strip": true
} }

View File

@ -2,7 +2,7 @@
## v0.33 - *gauge* ## v0.33 - *gauge*
Requires libvips v8.14.5 Requires libvips v8.15.0
### v0.33.0 - TBD ### v0.33.0 - TBD

View File

@ -15,7 +15,7 @@
}, },
"preferUnplugged": true, "preferUnplugged": true,
"optionalDependencies": { "optionalDependencies": {
"@img/sharp-libvips-darwin-arm64": "0.0.1" "@img/sharp-libvips-darwin-arm64": "0.0.3"
}, },
"files": [ "files": [
"lib" "lib"

View File

@ -15,7 +15,7 @@
}, },
"preferUnplugged": true, "preferUnplugged": true,
"optionalDependencies": { "optionalDependencies": {
"@img/sharp-libvips-darwin-x64": "0.0.1" "@img/sharp-libvips-darwin-x64": "0.0.3"
}, },
"files": [ "files": [
"lib" "lib"

View File

@ -15,7 +15,7 @@
}, },
"preferUnplugged": true, "preferUnplugged": true,
"optionalDependencies": { "optionalDependencies": {
"@img/sharp-libvips-linux-arm": "0.0.1" "@img/sharp-libvips-linux-arm": "0.0.3"
}, },
"files": [ "files": [
"lib" "lib"

View File

@ -15,7 +15,7 @@
}, },
"preferUnplugged": true, "preferUnplugged": true,
"optionalDependencies": { "optionalDependencies": {
"@img/sharp-libvips-linux-arm64": "0.0.1" "@img/sharp-libvips-linux-arm64": "0.0.3"
}, },
"files": [ "files": [
"lib" "lib"

View File

@ -15,7 +15,7 @@
}, },
"preferUnplugged": true, "preferUnplugged": true,
"optionalDependencies": { "optionalDependencies": {
"@img/sharp-libvips-linux-s390x": "0.0.2" "@img/sharp-libvips-linux-s390x": "0.0.3"
}, },
"files": [ "files": [
"lib" "lib"

View File

@ -15,7 +15,7 @@
}, },
"preferUnplugged": true, "preferUnplugged": true,
"optionalDependencies": { "optionalDependencies": {
"@img/sharp-libvips-linux-x64": "0.0.1" "@img/sharp-libvips-linux-x64": "0.0.3"
}, },
"files": [ "files": [
"lib" "lib"

View File

@ -15,7 +15,7 @@
}, },
"preferUnplugged": true, "preferUnplugged": true,
"optionalDependencies": { "optionalDependencies": {
"@img/sharp-libvips-linuxmusl-arm64": "0.0.1" "@img/sharp-libvips-linuxmusl-arm64": "0.0.3"
}, },
"files": [ "files": [
"lib" "lib"

View File

@ -15,7 +15,7 @@
}, },
"preferUnplugged": true, "preferUnplugged": true,
"optionalDependencies": { "optionalDependencies": {
"@img/sharp-libvips-linuxmusl-x64": "0.0.1" "@img/sharp-libvips-linuxmusl-x64": "0.0.3"
}, },
"files": [ "files": [
"lib" "lib"

View File

@ -142,14 +142,14 @@
"optionalDependencies": { "optionalDependencies": {
"@img/sharp-darwin-arm64": "0.33.0-alpha.9", "@img/sharp-darwin-arm64": "0.33.0-alpha.9",
"@img/sharp-darwin-x64": "0.33.0-alpha.9", "@img/sharp-darwin-x64": "0.33.0-alpha.9",
"@img/sharp-libvips-darwin-arm64": "0.0.1", "@img/sharp-libvips-darwin-arm64": "0.0.3",
"@img/sharp-libvips-darwin-x64": "0.0.1", "@img/sharp-libvips-darwin-x64": "0.0.3",
"@img/sharp-libvips-linux-arm": "0.0.1", "@img/sharp-libvips-linux-arm": "0.0.3",
"@img/sharp-libvips-linux-arm64": "0.0.1", "@img/sharp-libvips-linux-arm64": "0.0.3",
"@img/sharp-libvips-linux-s390x": "0.0.2", "@img/sharp-libvips-linux-s390x": "0.0.3",
"@img/sharp-libvips-linux-x64": "0.0.1", "@img/sharp-libvips-linux-x64": "0.0.3",
"@img/sharp-libvips-linuxmusl-arm64": "0.0.1", "@img/sharp-libvips-linuxmusl-arm64": "0.0.3",
"@img/sharp-libvips-linuxmusl-x64": "0.0.1", "@img/sharp-libvips-linuxmusl-x64": "0.0.3",
"@img/sharp-linux-arm": "0.33.0-alpha.9", "@img/sharp-linux-arm": "0.33.0-alpha.9",
"@img/sharp-linux-arm64": "0.33.0-alpha.9", "@img/sharp-linux-arm64": "0.33.0-alpha.9",
"@img/sharp-linux-s390x": "0.33.0-alpha.9", "@img/sharp-linux-s390x": "0.33.0-alpha.9",
@ -160,9 +160,9 @@
"@img/sharp-win32-x64": "0.33.0-alpha.9" "@img/sharp-win32-x64": "0.33.0-alpha.9"
}, },
"devDependencies": { "devDependencies": {
"@img/sharp-libvips-dev": "0.0.1", "@img/sharp-libvips-dev": "0.0.3",
"@img/sharp-libvips-win32-ia32": "0.0.1", "@img/sharp-libvips-win32-ia32": "0.0.3",
"@img/sharp-libvips-win32-x64": "0.0.1", "@img/sharp-libvips-win32-x64": "0.0.3",
"@types/node": "*", "@types/node": "*",
"async": "^3.2.4", "async": "^3.2.4",
"cc": "^3.0.1", "cc": "^3.0.1",
@ -182,7 +182,7 @@
"license": "Apache-2.0", "license": "Apache-2.0",
"engines": { "engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0", "node": "^18.17.0 || ^20.3.0 || >=21.0.0",
"libvips": ">=8.14.5" "libvips": ">=8.15.0"
}, },
"funding": { "funding": {
"url": "https://opencollective.com/libvips" "url": "https://opencollective.com/libvips"

View File

@ -33,11 +33,11 @@
'<(sharp_libvips_lib_dir)/glib-2.0/include' '<(sharp_libvips_lib_dir)/glib-2.0/include'
], ],
'link_settings': { 'link_settings': {
'library_dirs': ['<(sharp_libvips_lib_dir)'], 'library_dirs': [
'<(sharp_libvips_lib_dir)'
],
'libraries': [ 'libraries': [
'libvips.lib', 'libvips.lib'
'libglib-2.0.lib',
'libgobject-2.0.lib'
], ],
}, },
'configurations': { 'configurations': {
@ -141,9 +141,7 @@
], ],
'link_settings': { 'link_settings': {
'libraries': [ 'libraries': [
'libvips.lib', 'libvips.lib'
'libglib-2.0.lib',
'libgobject-2.0.lib'
] ]
} }
}], }],
@ -255,9 +253,7 @@
'copies': [{ 'copies': [{
'destination': 'build/Release', 'destination': 'build/Release',
'files': [ 'files': [
'<(sharp_libvips_lib_dir)/libvips-42.dll', '<(sharp_libvips_lib_dir)/libvips-42.dll'
'<(sharp_libvips_lib_dir)/libglib-2.0-0.dll',
'<(sharp_libvips_lib_dir)/libgobject-2.0-0.dll'
] ]
}] }]
}] }]

View File

@ -15,9 +15,9 @@
// Verify platform and compiler compatibility // Verify platform and compiler compatibility
#if (VIPS_MAJOR_VERSION < 8) || \ #if (VIPS_MAJOR_VERSION < 8) || \
(VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION < 14) || \ (VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION < 15) || \
(VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION == 14 && VIPS_MICRO_VERSION < 5) (VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION == 15 && VIPS_MICRO_VERSION < 0)
#error "libvips version 8.14.5+ is required - please see https://sharp.pixelplumbing.com/install" #error "libvips version 8.15.0+ 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)))

View File

@ -141,7 +141,7 @@ namespace sharp {
return image.conv(blur); return image.conv(blur);
} else { } else {
// Slower, accurate Gaussian blur // Slower, accurate Gaussian blur
return image.gaussblur(sigma); return StaySequential(image, VIPS_ACCESS_SEQUENTIAL).gaussblur(sigma);
} }
} }

View File

@ -485,9 +485,7 @@ class PipelineWorker : public Napi::AsyncWorker {
image = sharp::StaySequential(image, access); image = sharp::StaySequential(image, access);
image = image.smartcrop(baton->width, baton->height, VImage::option() image = image.smartcrop(baton->width, baton->height, VImage::option()
->set("interesting", baton->position == 16 ? VIPS_INTERESTING_ENTROPY : VIPS_INTERESTING_ATTENTION) ->set("interesting", baton->position == 16 ? VIPS_INTERESTING_ENTROPY : VIPS_INTERESTING_ATTENTION)
#if (VIPS_MAJOR_VERSION >= 8 && VIPS_MINOR_VERSION >= 15)
->set("premultiplied", shouldPremultiplyAlpha) ->set("premultiplied", shouldPremultiplyAlpha)
#endif
->set("attention_x", &attention_x) ->set("attention_x", &attention_x)
->set("attention_y", &attention_y)); ->set("attention_y", &attention_y));
baton->hasCropOffset = true; baton->hasCropOffset = true;

View File

@ -741,28 +741,6 @@ describe('Tile', function () {
}); });
}); });
it('Google layout with depth onepixel', function (done) {
const directory = fixtures.path('output.google_depth_onepixel.dzi');
fs.rm(directory, { recursive: true }, function () {
sharp(fixtures.inputJpg)
.tile({
layout: 'google',
depth: 'onepixel',
size: 256
})
.toFile(directory, function (err, info) {
if (err) throw err;
assert.strictEqual('dz', info.format);
assert.strictEqual(2725, info.width);
assert.strictEqual(2225, info.height);
assert.strictEqual(3, info.channels);
assert.strictEqual('number', typeof info.size);
assertGoogleTiles(directory, 256, 13, done);
});
});
});
it('Google layout with depth onetile', function (done) { it('Google layout with depth onetile', function (done) {
const directory = fixtures.path('output.google_depth_onetile.dzi'); const directory = fixtures.path('output.google_depth_onetile.dzi');
fs.rm(directory, { recursive: true }, function () { fs.rm(directory, { recursive: true }, function () {

View File

@ -11,7 +11,7 @@ const fixtures = require('../fixtures');
describe('Timeout', function () { describe('Timeout', function () {
it('Will timeout after 1s when performing slow blur operation', () => assert.rejects( it('Will timeout after 1s when performing slow blur operation', () => assert.rejects(
() => sharp(fixtures.inputJpg) () => sharp(fixtures.inputJpg)
.blur(100) .blur(200)
.timeout({ seconds: 1 }) .timeout({ seconds: 1 })
.toBuffer(), .toBuffer(),
/timeout: [0-9]+% complete/ /timeout: [0-9]+% complete/

View File

@ -49,7 +49,7 @@ describe('Tint', function () {
}); });
it('tints rgb image with sepia tone', function (done) { it('tints rgb image with sepia tone', function (done) {
const output = fixtures.path('output.tint-sepia.jpg'); const output = fixtures.path('output.tint-sepia-hex.jpg');
sharp(fixtures.inputJpg) sharp(fixtures.inputJpg)
.resize(320, 240, { fastShrinkOnLoad: false }) .resize(320, 240, { fastShrinkOnLoad: false })
.tint('#704214') .tint('#704214')
@ -63,7 +63,7 @@ describe('Tint', function () {
}); });
it('tints rgb image with sepia tone with rgb colour', function (done) { it('tints rgb image with sepia tone with rgb colour', function (done) {
const output = fixtures.path('output.tint-sepia.jpg'); const output = fixtures.path('output.tint-sepia-rgb.jpg');
sharp(fixtures.inputJpg) sharp(fixtures.inputJpg)
.resize(320, 240, { fastShrinkOnLoad: false }) .resize(320, 240, { fastShrinkOnLoad: false })
.tint([112, 66, 20]) .tint([112, 66, 20])