Skip to content

Commit

Permalink
Upgrade to libvips 8.15.0-rc2
Browse files Browse the repository at this point in the history
  • Loading branch information
lovell committed Nov 4, 2023
1 parent 7caaa8e commit 0f90d3d
Show file tree
Hide file tree
Showing 18 changed files with 35 additions and 63 deletions.
2 changes: 1 addition & 1 deletion .prebuildrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"runtime": "napi",
"include-regex": "(sharp-.+\\.node|libvips-.+\\.dll|libglib-.+\\.dll|libgobject-.+\\.dll)",
"include-regex": "(sharp-.+\\.node|libvips-.+\\.dll)",
"prerelease": true,
"strip": true
}
2 changes: 1 addition & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## v0.33 - *gauge*

Requires libvips v8.14.5
Requires libvips v8.15.0

### v0.33.0 - TBD

Expand Down
2 changes: 1 addition & 1 deletion npm/darwin-arm64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"preferUnplugged": true,
"optionalDependencies": {
"@img/sharp-libvips-darwin-arm64": "0.0.1"
"@img/sharp-libvips-darwin-arm64": "0.0.3"
},
"files": [
"lib"
Expand Down
2 changes: 1 addition & 1 deletion npm/darwin-x64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"preferUnplugged": true,
"optionalDependencies": {
"@img/sharp-libvips-darwin-x64": "0.0.1"
"@img/sharp-libvips-darwin-x64": "0.0.3"
},
"files": [
"lib"
Expand Down
2 changes: 1 addition & 1 deletion npm/linux-arm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"preferUnplugged": true,
"optionalDependencies": {
"@img/sharp-libvips-linux-arm": "0.0.1"
"@img/sharp-libvips-linux-arm": "0.0.3"
},
"files": [
"lib"
Expand Down
2 changes: 1 addition & 1 deletion npm/linux-arm64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"preferUnplugged": true,
"optionalDependencies": {
"@img/sharp-libvips-linux-arm64": "0.0.1"
"@img/sharp-libvips-linux-arm64": "0.0.3"
},
"files": [
"lib"
Expand Down
2 changes: 1 addition & 1 deletion npm/linux-s390x/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"preferUnplugged": true,
"optionalDependencies": {
"@img/sharp-libvips-linux-s390x": "0.0.2"
"@img/sharp-libvips-linux-s390x": "0.0.3"
},
"files": [
"lib"
Expand Down
2 changes: 1 addition & 1 deletion npm/linux-x64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"preferUnplugged": true,
"optionalDependencies": {
"@img/sharp-libvips-linux-x64": "0.0.1"
"@img/sharp-libvips-linux-x64": "0.0.3"
},
"files": [
"lib"
Expand Down
2 changes: 1 addition & 1 deletion npm/linuxmusl-arm64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"preferUnplugged": true,
"optionalDependencies": {
"@img/sharp-libvips-linuxmusl-arm64": "0.0.1"
"@img/sharp-libvips-linuxmusl-arm64": "0.0.3"
},
"files": [
"lib"
Expand Down
2 changes: 1 addition & 1 deletion npm/linuxmusl-x64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"preferUnplugged": true,
"optionalDependencies": {
"@img/sharp-libvips-linuxmusl-x64": "0.0.1"
"@img/sharp-libvips-linuxmusl-x64": "0.0.3"
},
"files": [
"lib"
Expand Down
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,14 @@
"optionalDependencies": {
"@img/sharp-darwin-arm64": "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-x64": "0.0.1",
"@img/sharp-libvips-linux-arm": "0.0.1",
"@img/sharp-libvips-linux-arm64": "0.0.1",
"@img/sharp-libvips-linux-s390x": "0.0.2",
"@img/sharp-libvips-linux-x64": "0.0.1",
"@img/sharp-libvips-linuxmusl-arm64": "0.0.1",
"@img/sharp-libvips-linuxmusl-x64": "0.0.1",
"@img/sharp-libvips-darwin-arm64": "0.0.3",
"@img/sharp-libvips-darwin-x64": "0.0.3",
"@img/sharp-libvips-linux-arm": "0.0.3",
"@img/sharp-libvips-linux-arm64": "0.0.3",
"@img/sharp-libvips-linux-s390x": "0.0.3",
"@img/sharp-libvips-linux-x64": "0.0.3",
"@img/sharp-libvips-linuxmusl-arm64": "0.0.3",
"@img/sharp-libvips-linuxmusl-x64": "0.0.3",
"@img/sharp-linux-arm": "0.33.0-alpha.9",
"@img/sharp-linux-arm64": "0.33.0-alpha.9",
"@img/sharp-linux-s390x": "0.33.0-alpha.9",
Expand All @@ -160,9 +160,9 @@
"@img/sharp-win32-x64": "0.33.0-alpha.9"
},
"devDependencies": {
"@img/sharp-libvips-dev": "0.0.1",
"@img/sharp-libvips-win32-ia32": "0.0.1",
"@img/sharp-libvips-win32-x64": "0.0.1",
"@img/sharp-libvips-dev": "0.0.3",
"@img/sharp-libvips-win32-ia32": "0.0.3",
"@img/sharp-libvips-win32-x64": "0.0.3",
"@types/node": "*",
"async": "^3.2.4",
"cc": "^3.0.1",
Expand All @@ -182,7 +182,7 @@
"license": "Apache-2.0",
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0",
"libvips": ">=8.14.5"
"libvips": ">=8.15.0"
},
"funding": {
"url": "https://opencollective.com/libvips"
Expand Down
16 changes: 6 additions & 10 deletions src/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
'<(sharp_libvips_lib_dir)/glib-2.0/include'
],
'link_settings': {
'library_dirs': ['<(sharp_libvips_lib_dir)'],
'library_dirs': [
'<(sharp_libvips_lib_dir)'
],
'libraries': [
'libvips.lib',
'libglib-2.0.lib',
'libgobject-2.0.lib'
'libvips.lib'
],
},
'configurations': {
Expand Down Expand Up @@ -141,9 +141,7 @@
],
'link_settings': {
'libraries': [
'libvips.lib',
'libglib-2.0.lib',
'libgobject-2.0.lib'
'libvips.lib'
]
}
}],
Expand Down Expand Up @@ -255,9 +253,7 @@
'copies': [{
'destination': 'build/Release',
'files': [
'<(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'
'<(sharp_libvips_lib_dir)/libvips-42.dll'
]
}]
}]
Expand Down
6 changes: 3 additions & 3 deletions src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
// Verify platform and compiler compatibility

#if (VIPS_MAJOR_VERSION < 8) || \
(VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION < 14) || \
(VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION == 14 && VIPS_MICRO_VERSION < 5)
#error "libvips version 8.14.5+ is required - please see https://sharp.pixelplumbing.com/install"
(VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION < 15) || \
(VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION == 15 && VIPS_MICRO_VERSION < 0)
#error "libvips version 8.15.0+ is required - please see https://sharp.pixelplumbing.com/install"
#endif

#if ((!defined(__clang__)) && defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6)))
Expand Down
2 changes: 1 addition & 1 deletion src/operations.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ namespace sharp {
return image.conv(blur);
} else {
// Slower, accurate Gaussian blur
return image.gaussblur(sigma);
return StaySequential(image, VIPS_ACCESS_SEQUENTIAL).gaussblur(sigma);
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/pipeline.cc
Original file line number Diff line number Diff line change
Expand Up @@ -485,9 +485,7 @@ class PipelineWorker : public Napi::AsyncWorker {
image = sharp::StaySequential(image, access);
image = image.smartcrop(baton->width, baton->height, VImage::option()
->set("interesting", baton->position == 16 ? VIPS_INTERESTING_ENTROPY : VIPS_INTERESTING_ATTENTION)
#if (VIPS_MAJOR_VERSION >= 8 && VIPS_MINOR_VERSION >= 15)
->set("premultiplied", shouldPremultiplyAlpha)
#endif
->set("attention_x", &attention_x)
->set("attention_y", &attention_y));
baton->hasCropOffset = true;
Expand Down
22 changes: 0 additions & 22 deletions test/unit/tile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
const directory = fixtures.path('output.google_depth_onetile.dzi');
fs.rm(directory, { recursive: true }, function () {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/timeout.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const fixtures = require('../fixtures');
describe('Timeout', function () {
it('Will timeout after 1s when performing slow blur operation', () => assert.rejects(
() => sharp(fixtures.inputJpg)
.blur(100)
.blur(200)
.timeout({ seconds: 1 })
.toBuffer(),
/timeout: [0-9]+% complete/
Expand Down
4 changes: 2 additions & 2 deletions test/unit/tint.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('Tint', function () {
});

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)
.resize(320, 240, { fastShrinkOnLoad: false })
.tint('#704214')
Expand All @@ -63,7 +63,7 @@ describe('Tint', function () {
});

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)
.resize(320, 240, { fastShrinkOnLoad: false })
.tint([112, 66, 20])
Expand Down

0 comments on commit 0f90d3d

Please sign in to comment.