🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

sharp

Package Overview
Dependencies
Maintainers
1
Versions
189
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sharp - npm Package Compare versions

Comparing version
0.35.0-rc.0
to
0.35.0-rc.2
+3
-2
lib/constructor.js

@@ -156,3 +156,3 @@ /*!

* @param {boolean} [options.sequentialRead=true] - Set this to `false` to use random access rather than sequential read. Some operations will do this automatically.
* @param {number} [options.density=72] - number representing the DPI for vector images in the range 1 to 100000.
* @param {number} [options.density=72] - The DPI at which to render SVG and PDF images, in the range 1 to 100000.
* @param {number} [options.ignoreIcc=false] - should the embedded ICC profile, if any, be ignored.

@@ -319,2 +319,3 @@ * @param {number} [options.pages=1] - Number of pages to extract for multi-page input (GIF, WebP, TIFF), use -1 for all pages.

withXmp: '',
keepGainMap: false,
withGainMap: false,

@@ -371,3 +372,3 @@ resolveWithObject: false,

tiffMiniswhite: false,
tiffBitdepth: 8,
tiffBitdepth: 0,
tiffTile: false,

@@ -374,0 +375,0 @@ tiffTileHeight: 256,

+1
-0

@@ -570,2 +570,3 @@ /*!

* - `format`: Name of decoder used to parse image e.g. `jpeg`, `png`, `webp`, `gif`, `svg`, `heif`, `tiff`
* - `mediaType`: Media Type (MIME Type) e.g. `image/jpeg`, `image/png`, `image/svg+xml`, `image/avif`
* - `size`: Total size of image in bytes, for Stream and Buffer input only

@@ -572,0 +573,0 @@ * - `width`: Number of pixels wide (EXIF orientation is not taken into consideration, see example below)

@@ -21,3 +21,4 @@ /*!

'darwin-arm64', 'darwin-x64',
'linux-arm', 'linux-arm64', 'linux-ppc64', 'linux-riscv64', 'linux-s390x', 'linux-x64',
'freebsd-arm64', 'freebsd-x64',
'linux-arm', 'linux-arm64', 'linux-ppc64', 'linux-riscv64', 'linux-s390x', 'linux-wasm32', 'linux-x64',
'linuxmusl-arm64', 'linuxmusl-x64',

@@ -40,3 +41,4 @@ 'win32-arm64', 'win32-ia32', 'win32-x64'

/* node:coverage ignore next */
/* node:coverage disable */
const runtimeLibc = () => detectLibc.isNonGlibcLinuxSync() ? detectLibc.familySync() : '';

@@ -47,3 +49,2 @@

const buildPlatformArch = () => {
/* node:coverage ignore next 3 */
if (isEmscripten()) {

@@ -61,3 +62,2 @@ return 'wasm32';

} catch {
/* node:coverage ignore next 5 */
try {

@@ -71,3 +71,2 @@ return require('@img/sharp-libvips-dev/include');

const buildSharpLibvipsCPlusPlusDir = () => {
/* node:coverage ignore next 4 */
try {

@@ -83,3 +82,2 @@ return require('@img/sharp-libvips-dev/cplusplus');

} catch {
/* node:coverage ignore next 5 */
try {

@@ -92,4 +90,2 @@ return require(`@img/sharp-libvips-${buildPlatformArch()}/lib`);

/* node:coverage disable */
const isUnsupportedNodeRuntime = () => {

@@ -154,2 +150,22 @@ if (process.release?.name === 'node' && process.versions) {

const getBrewPkgConfigPath = () => {
try {
const brewPrefix = (spawnSync('brew', ['--prefix'], { encoding: 'utf8' }).stdout || '').trim();
if (brewPrefix) {
return `${brewPrefix}/lib/pkgconfig`;
}
} catch (_err) {}
return undefined;
};
const getPkgConfigPath = () => {
try {
const pkgConfigPath = (spawnSync('pkg-config', ['--variable', 'pc_path', 'pkg-config'], { encoding: 'utf8' }).stdout || '').trim();
if (pkgConfigPath) {
return pkgConfigPath;
}
} catch (_err) {}
return undefined;
};
/* node:coverage enable */

@@ -159,14 +175,6 @@

if (process.platform !== 'win32') {
/* node:coverage ignore next 4 */
const brewPkgConfigPath = spawnSync(
'which brew >/dev/null 2>&1 && brew environment --plain | grep PKG_CONFIG_LIBDIR | cut -d" " -f2',
spawnSyncOptions
).stdout || '';
return [
brewPkgConfigPath.trim(),
process.env.PKG_CONFIG_PATH,
'/usr/local/lib/pkgconfig',
'/usr/lib/pkgconfig',
'/usr/local/libdata/pkgconfig',
'/usr/libdata/pkgconfig'
getBrewPkgConfigPath(),
getPkgConfigPath(),
process.env.PKG_CONFIG_PATH
].filter(Boolean).join(':');

@@ -173,0 +181,0 @@ } else {

@@ -14,17 +14,52 @@ /*!

const paths = [
`../src/build/Release/sharp-${runtimePlatform}-${version}.node`,
`../src/build/Release/sharp-wasm32-${version}.node`,
`@img/sharp-${runtimePlatform}/sharp.node`,
'@img/sharp-wasm32/sharp.node'
];
/* node:coverage disable */
let path, sharp;
const prebuiltBinaryForRuntime = () => {
switch (runtimePlatform) {
case 'darwin-arm64':
return require('@img/sharp-darwin-arm64/sharp.node');
case 'darwin-x64':
return require('@img/sharp-darwin-x64/sharp.node');
case 'linux-arm':
return require('@img/sharp-linux-arm/sharp.node');
case 'linux-arm64':
return require('@img/sharp-linux-arm64/sharp.node');
case 'linux-ppc64':
return require('@img/sharp-linux-ppc64/sharp.node');
case 'linux-riscv64':
return require('@img/sharp-linux-riscv64/sharp.node');
case 'linux-s390x':
return require('@img/sharp-linux-s390x/sharp.node');
case 'linux-x64':
return require('@img/sharp-linux-x64/sharp.node');
case 'linuxmusl-arm64':
return require('@img/sharp-linuxmusl-arm64/sharp.node') ;
case 'linuxmusl-x64':
return require('@img/sharp-linuxmusl-x64/sharp.node');
case 'win32-arm64':
return require('@img/sharp-win32-arm64/sharp.node');
case 'win32-ia32':
return require('@img/sharp-win32-ia32/sharp.node');
case 'win32-x64':
return require('@img/sharp-win32-x64/sharp.node');
case 'freebsd-arm64':
case 'freebsd-x64':
return require('@img/sharp-freebsd-wasm32/sharp.node');
case 'linux-wasm32':
return require('@img/sharp-webcontainers-wasm32/sharp.node');
default:
return require('@img/sharp-wasm32/sharp.node');
}
};
let sharp;
const errors = [];
for (path of paths) {
try {
sharp = require(`../src/build/Release/sharp-${runtimePlatform}-${version}.node`);
} catch (err) {
errors.push(err);
}
if (!sharp) {
try {
sharp = require(path);
break;
sharp = require(`../src/build/Release/sharp-wasm32-${version}.node`);
} catch (err) {

@@ -34,8 +69,14 @@ errors.push(err);

}
if (sharp && path.startsWith('@img/sharp-linux-x64') && !sharp._isUsingX64V2()) {
const err = new Error('Prebuilt binaries for linux-x64 require v2 microarchitecture');
err.code = 'Unsupported CPU';
errors.push(err);
sharp = null;
if (!sharp) {
try {
sharp = prebuiltBinaryForRuntime();
if (['linux-x64', 'linuxmusl-x64'].includes(runtimePlatform) && !sharp._isUsingX64V2()) {
const err = new Error('Prebuilt binaries for Linux x64 require v2 microarchitecture');
err.code = 'Unsupported CPU';
errors.push(err);
sharp = null;
}
} catch (err) {
errors.push(err);
}
}

@@ -79,5 +120,4 @@

' See https://sharp.pixelplumbing.com/install#building-from-source',
'- Add experimental WebAssembly-based dependencies:',
' npm install --cpu=wasm32 sharp',
' npm install @img/sharp-wasm32'
'- Add WebAssembly-based dependencies:',
' npm install sharp @img/sharp-wasm32'
);

@@ -84,0 +124,0 @@ }

{
"name": "sharp",
"description": "High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",
"version": "0.35.0-rc.0",
"version": "0.35.0-rc.2",
"author": "Lovell Fuller <npm@lovell.info>",

@@ -106,2 +106,3 @@ "homepage": "https://sharp.pixelplumbing.com",

"package-from-local-build": "node npm/from-local-build.js",
"package-wasm-wrappers": "node npm/wasm-wrappers.js",
"package-release-notes": "node npm/release-notes.js",

@@ -143,49 +144,50 @@ "docs-build": "node docs/build.mjs",

"dependencies": {
"@img/colour": "^1.0.0",
"@img/colour": "^1.1.0",
"detect-libc": "^2.1.2",
"semver": "^7.7.3"
"semver": "^7.7.4"
},
"optionalDependencies": {
"@img/sharp-darwin-arm64": "0.35.0-rc.0",
"@img/sharp-darwin-x64": "0.35.0-rc.0",
"@img/sharp-libvips-darwin-arm64": "1.3.0-rc.2",
"@img/sharp-libvips-darwin-x64": "1.3.0-rc.2",
"@img/sharp-libvips-linux-arm": "1.3.0-rc.2",
"@img/sharp-libvips-linux-arm64": "1.3.0-rc.2",
"@img/sharp-libvips-linux-ppc64": "1.3.0-rc.2",
"@img/sharp-libvips-linux-riscv64": "1.3.0-rc.2",
"@img/sharp-libvips-linux-s390x": "1.3.0-rc.2",
"@img/sharp-libvips-linux-x64": "1.3.0-rc.2",
"@img/sharp-libvips-linuxmusl-arm64": "1.3.0-rc.2",
"@img/sharp-libvips-linuxmusl-x64": "1.3.0-rc.2",
"@img/sharp-linux-arm": "0.35.0-rc.0",
"@img/sharp-linux-arm64": "0.35.0-rc.0",
"@img/sharp-linux-ppc64": "0.35.0-rc.0",
"@img/sharp-linux-riscv64": "0.35.0-rc.0",
"@img/sharp-linux-s390x": "0.35.0-rc.0",
"@img/sharp-linux-x64": "0.35.0-rc.0",
"@img/sharp-linuxmusl-arm64": "0.35.0-rc.0",
"@img/sharp-linuxmusl-x64": "0.35.0-rc.0",
"@img/sharp-wasm32": "0.35.0-rc.0",
"@img/sharp-win32-arm64": "0.35.0-rc.0",
"@img/sharp-win32-ia32": "0.35.0-rc.0",
"@img/sharp-win32-x64": "0.35.0-rc.0"
"@img/sharp-darwin-arm64": "0.35.0-rc.2",
"@img/sharp-darwin-x64": "0.35.0-rc.2",
"@img/sharp-freebsd-wasm32": "0.35.0-rc.2",
"@img/sharp-libvips-darwin-arm64": "1.3.0-rc.4",
"@img/sharp-libvips-darwin-x64": "1.3.0-rc.4",
"@img/sharp-libvips-linux-arm": "1.3.0-rc.4",
"@img/sharp-libvips-linux-arm64": "1.3.0-rc.4",
"@img/sharp-libvips-linux-ppc64": "1.3.0-rc.4",
"@img/sharp-libvips-linux-riscv64": "1.3.0-rc.4",
"@img/sharp-libvips-linux-s390x": "1.3.0-rc.4",
"@img/sharp-libvips-linux-x64": "1.3.0-rc.4",
"@img/sharp-libvips-linuxmusl-arm64": "1.3.0-rc.4",
"@img/sharp-libvips-linuxmusl-x64": "1.3.0-rc.4",
"@img/sharp-linux-arm": "0.35.0-rc.2",
"@img/sharp-linux-arm64": "0.35.0-rc.2",
"@img/sharp-linux-ppc64": "0.35.0-rc.2",
"@img/sharp-linux-riscv64": "0.35.0-rc.2",
"@img/sharp-linux-s390x": "0.35.0-rc.2",
"@img/sharp-linux-x64": "0.35.0-rc.2",
"@img/sharp-linuxmusl-arm64": "0.35.0-rc.2",
"@img/sharp-linuxmusl-x64": "0.35.0-rc.2",
"@img/sharp-webcontainers-wasm32": "0.35.0-rc.2",
"@img/sharp-win32-arm64": "0.35.0-rc.2",
"@img/sharp-win32-ia32": "0.35.0-rc.2",
"@img/sharp-win32-x64": "0.35.0-rc.2"
},
"devDependencies": {
"@biomejs/biome": "^2.3.10",
"@biomejs/biome": "^2.4.10",
"@cpplint/cli": "^0.1.0",
"@emnapi/runtime": "^1.7.1",
"@img/sharp-libvips-dev": "1.3.0-rc.2",
"@img/sharp-libvips-dev-wasm32": "1.3.0-rc.2",
"@img/sharp-libvips-win32-arm64": "1.3.0-rc.2",
"@img/sharp-libvips-win32-ia32": "1.3.0-rc.2",
"@img/sharp-libvips-win32-x64": "1.3.0-rc.2",
"@emnapi/runtime": "^1.9.2",
"@img/sharp-libvips-dev": "1.3.0-rc.4",
"@img/sharp-libvips-dev-wasm32": "1.3.0-rc.4",
"@img/sharp-libvips-win32-arm64": "1.3.0-rc.4",
"@img/sharp-libvips-win32-ia32": "1.3.0-rc.4",
"@img/sharp-libvips-win32-x64": "1.3.0-rc.4",
"@types/node": "*",
"emnapi": "^1.7.1",
"emnapi": "^1.9.2",
"exif-reader": "^2.0.3",
"extract-zip": "^2.0.1",
"icc": "^3.0.0",
"node-addon-api": "^8.5.0",
"node-gyp": "^12.1.0",
"tar-fs": "^3.1.1",
"node-addon-api": "^8.7.0",
"node-gyp": "^12.2.0",
"tar-fs": "^3.1.2",
"tsd": "^0.33.0"

@@ -198,3 +200,3 @@ },

"config": {
"libvips": ">=8.18.0"
"libvips": ">=8.18.2"
},

@@ -201,0 +203,0 @@ "funding": {

@@ -44,24 +44,16 @@ # sharp

### Callback
```javascript
sharp(inputBuffer)
.resize(320, 240)
await sharp(inputBuffer)
.resize({ width: 320, height: 240 })
.toFile('output.webp', (err, info) => { ... });
```
### Promise
```javascript
sharp('input.jpg')
.rotate()
.resize(200)
const output = await sharp('input.jpg')
.autoOrient()
.resize({ width: 200 })
.jpeg({ mozjpeg: true })
.toBuffer()
.then( data => { ... })
.catch( err => { ... });
.toBuffer();
```
### Async/await
```javascript

@@ -80,4 +72,2 @@ const semiTransparentRedPng = await sharp({

### Stream
```javascript

@@ -84,0 +74,0 @@ const roundedCorners = Buffer.from(

@@ -429,3 +429,3 @@ /*!

option->set("n", descriptor->pages);
option->set("page", descriptor->page);
option->set("page", std::max(0, descriptor->page));
}

@@ -461,2 +461,18 @@ switch (imageType) {

/*
Should HEIF image be re-opened using the primary item?
*/
static bool HeifPrimaryPageReopen(VImage image, InputDescriptor *descriptor) {
if (image.get_typeof(VIPS_META_N_PAGES) == G_TYPE_INT && image.get_typeof("heif-primary") == G_TYPE_INT) {
if (image.get_int(VIPS_META_N_PAGES) > 1 && descriptor->pages == 1 && descriptor->page == -1) {
int const pagePrimary = image.get_int("heif-primary");
if (pagePrimary != 0) {
descriptor->page = pagePrimary;
return true;
}
}
}
return false;
}
/*
Open an image from the given InputDescriptor (filesystem, compressed buffer, raw pixel data)

@@ -495,8 +511,11 @@ */

image = SetDensity(image, descriptor->density);
} else if (imageType == ImageType::HEIF && HeifPrimaryPageReopen(image, descriptor)) {
option = GetOptionsForImageType(imageType, descriptor);
image = VImage::new_from_buffer(descriptor->buffer, descriptor->bufferLength, nullptr, option);
}
} catch (vips::VError const &err) {
throw vips::VError(std::string("Input buffer has corrupt header: ") + err.what());
} catch (std::runtime_error const &err) {
throw std::runtime_error(std::string("Input buffer has corrupt header: ") + err.what());
}
} else {
throw vips::VError("Input buffer contains unsupported image format");
throw std::runtime_error("Input buffer contains unsupported image format");
}

@@ -572,6 +591,6 @@ }

if (descriptor->file.find("<svg") != std::string::npos) {
throw vips::VError("Input file is missing, did you mean "
throw std::runtime_error("Input file is missing, did you mean "
"sharp(Buffer.from('" + descriptor->file.substr(0, 8) + "...')?");
}
throw vips::VError("Input file is missing: " + descriptor->file);
throw std::runtime_error("Input file is missing: " + descriptor->file);
}

@@ -584,8 +603,11 @@ if (imageType != ImageType::UNKNOWN) {

image = SetDensity(image, descriptor->density);
} else if (imageType == ImageType::HEIF && HeifPrimaryPageReopen(image, descriptor)) {
option = GetOptionsForImageType(imageType, descriptor);
image = VImage::new_from_file(descriptor->file.data(), option);
}
} catch (vips::VError const &err) {
throw vips::VError(std::string("Input file has corrupt header: ") + err.what());
} catch (std::runtime_error const &err) {
throw std::runtime_error(std::string("Input file has corrupt header: ") + err.what());
}
} else {
throw vips::VError("Input file contains unsupported image format");
throw std::runtime_error("Input file contains unsupported image format");
}

@@ -598,3 +620,3 @@ }

static_cast<uint64_t>(image.width()) * image.height() > descriptor->limitInputPixels) {
throw vips::VError("Input image exceeds pixel limit");
throw std::runtime_error("Input image exceeds pixel limit");
}

@@ -775,15 +797,15 @@ return std::make_tuple(image, imageType);

if (image.width() > 65535 || height > 65535) {
throw vips::VError("Processed image is too large for the JPEG format");
throw std::runtime_error("Processed image is too large for the JPEG format");
}
} else if (imageType == ImageType::WEBP) {
if (image.width() > 16383 || height > 16383) {
throw vips::VError("Processed image is too large for the WebP format");
throw std::runtime_error("Processed image is too large for the WebP format");
}
} else if (imageType == ImageType::GIF) {
if (image.width() > 65535 || height > 65535) {
throw vips::VError("Processed image is too large for the GIF format");
throw std::runtime_error("Processed image is too large for the GIF format");
}
} else if (imageType == ImageType::HEIF) {
if (image.width() > 16384 || height > 16384) {
throw vips::VError("Processed image is too large for the HEIF format");
throw std::runtime_error("Processed image is too large for the HEIF format");
}

@@ -1152,3 +1174,4 @@ }

bool HasGainMap(VImage image) {
return image.get_typeof("gainmap-data") == VIPS_TYPE_BLOB;
return image.get_typeof("gainmap") == VIPS_TYPE_BLOB ||
image.get_typeof("gainmap-data") == VIPS_TYPE_BLOB;
}

@@ -1161,2 +1184,3 @@

VImage copy = image.copy();
copy.remove("gainmap");
copy.remove("gainmap-data");

@@ -1163,0 +1187,0 @@ return copy;

@@ -22,4 +22,4 @@ /*!

(VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION < 18) || \
(VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION == 18 && VIPS_MICRO_VERSION < 0)
#error "libvips version 8.18.0+ is required - please see https://sharp.pixelplumbing.com/install"
(VIPS_MAJOR_VERSION == 8 && VIPS_MINOR_VERSION == 18 && VIPS_MICRO_VERSION < 2)
#error "libvips version 8.18.2+ is required - please see https://sharp.pixelplumbing.com/install"
#endif

@@ -33,2 +33,8 @@

#ifdef __EMSCRIPTEN__
#define SHARP_CALLBACK_FN_NAME Call
#else
#define SHARP_CALLBACK_FN_NAME MakeCallback
#endif
using vips::VImage;

@@ -110,3 +116,3 @@

pages(1),
page(0),
page(-1),
createChannels(0),

@@ -113,0 +119,0 @@ createWidth(0),

@@ -34,3 +34,3 @@ /*!

std::tie(image, imageType) = OpenInput(baton->input);
} catch (vips::VError const &err) {
} catch (std::runtime_error const &err) {
(baton->err).append(err.what());

@@ -155,2 +155,46 @@ }

vips_image_map(image.get_image(), readPNGComment, &baton->comments);
// Media type
std::string mediaType;
switch (imageType) {
case sharp::ImageType::JPEG:
case sharp::ImageType::PNG:
case sharp::ImageType::WEBP:
case sharp::ImageType::JP2:
case sharp::ImageType::TIFF:
case sharp::ImageType::GIF:
case sharp::ImageType::FITS:
case sharp::ImageType::JXL:
baton->mediaType = "image/" + baton->format;
break;
case sharp::ImageType::SVG:
baton->mediaType = "image/svg+xml";
break;
case sharp::ImageType::HEIF:
if (baton->compression == "av1") {
baton->mediaType = "image/avif";
} else if (baton->compression == "hevc") {
baton->mediaType = "image/heic";
}
break;
case sharp::ImageType::PDF:
baton->mediaType = "application/pdf";
break;
case sharp::ImageType::OPENSLIDE:
baton->mediaType = "image/tiff";
break;
case sharp::ImageType::PPM:
baton->mediaType = "image/x-portable-pixmap";
break;
case sharp::ImageType::EXR:
baton->mediaType = "image/x-exr";
break;
case sharp::ImageType::RAD:
baton->mediaType = "image/vnd.radiance";
break;
case sharp::ImageType::UHDR:
baton->mediaType = "image/jpeg";
break;
default:
break;
}
}

@@ -170,3 +214,3 @@

while (!warning.empty()) {
debuglog.Call(Receiver().Value(), { Napi::String::New(env, warning) });
debuglog.SHARP_CALLBACK_FN_NAME(Receiver().Value(), { Napi::String::New(env, warning) });
warning = sharp::VipsWarningPop();

@@ -178,2 +222,5 @@ }

info.Set("format", baton->format);
if (!baton->mediaType.empty()) {
info.Set("mediaType", baton->mediaType);
}
if (baton->input->bufferLength > 0) {

@@ -304,5 +351,6 @@ info.Set("size", baton->input->bufferLength);

}
Callback().Call(Receiver().Value(), { env.Null(), info });
Callback().SHARP_CALLBACK_FN_NAME(Receiver().Value(), { env.Null(), info });
} else {
Callback().Call(Receiver().Value(), { Napi::Error::New(env, sharp::TrimEnd(baton->err)).Value() });
Callback().SHARP_CALLBACK_FN_NAME(Receiver().Value(),
{ Napi::Error::New(env, sharp::TrimEnd(baton->err)).Value() });
}

@@ -309,0 +357,0 @@

@@ -22,2 +22,3 @@ /*!

std::string format;
std::string mediaType;
int width;

@@ -24,0 +25,0 @@ int height;

@@ -17,3 +17,2 @@ /*!

using vips::VImage;
using vips::VError;

@@ -291,3 +290,3 @@ namespace sharp {

if (image.width() < 3 && image.height() < 3) {
throw VError("Image to trim must be at least 3x3 pixels");
throw std::runtime_error("Image to trim must be at least 3x3 pixels");
}

@@ -366,3 +365,3 @@ if (background.size() == 0) {

if (a.size() > bands) {
throw VError("Band expansion using linear is unsupported");
throw std::runtime_error("Band expansion using linear is unsupported");
}

@@ -369,0 +368,0 @@ bool const uchar = !Is16Bit(image.interpretation());

@@ -216,2 +216,3 @@ /*!

bool withGainMap;
bool keepGainMap;
int timeoutSeconds;

@@ -369,3 +370,3 @@ std::vector<double> convKernel;

tiffPyramid(false),
tiffBitdepth(8),
tiffBitdepth(0),
tiffMiniswhite(false),

@@ -396,2 +397,3 @@ tiffTile(false),

withGainMap(false),
keepGainMap(false),
timeoutSeconds(0),

@@ -398,0 +400,0 @@ convKernelWidth(0),

@@ -42,3 +42,3 @@ /*!

std::tie(image, imageType) = OpenInput(baton->input);
} catch (vips::VError const &err) {
} catch (std::runtime_error const &err) {
(baton->err).append(err.what());

@@ -96,3 +96,3 @@ }

baton->dominantBlue = dz * 16 + 8;
} catch (vips::VError const &err) {
} catch (std::runtime_error const &err) {
(baton->err).append(err.what());

@@ -114,6 +114,5 @@ }

while (!warning.empty()) {
debuglog.Call(Receiver().Value(), { Napi::String::New(env, warning) });
debuglog.SHARP_CALLBACK_FN_NAME(Receiver().Value(), { Napi::String::New(env, warning) });
warning = sharp::VipsWarningPop();
}
if (baton->err.empty()) {

@@ -150,5 +149,6 @@ // Stats Object

info.Set("dominant", dominant);
Callback().Call(Receiver().Value(), { env.Null(), info });
Callback().SHARP_CALLBACK_FN_NAME(Receiver().Value(), { env.Null(), info });
} else {
Callback().Call(Receiver().Value(), { Napi::Error::New(env, sharp::TrimEnd(baton->err)).Value() });
Callback().SHARP_CALLBACK_FN_NAME(Receiver().Value(),
{ Napi::Error::New(env, sharp::TrimEnd(baton->err)).Value() });
}

@@ -155,0 +155,0 @@

@@ -247,3 +247,3 @@ /*!

maxColourDistance = image1.dE00(image2).max();
} catch (vips::VError const &err) {
} catch (std::runtime_error const &err) {
throw Napi::Error::New(env, err.what());

@@ -250,0 +250,0 @@ }

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display