Compare commits

..

No commits in common. "c1c16ed3e671817dc4780dba0dbdaa59f2fe592b" and "1bbee519aa33205cee9da8f0ad26b26b08a5a520" have entirely different histories.

8 changed files with 7 additions and 29 deletions

View File

@ -1,5 +1,5 @@
{ {
"$schema": "https://biomejs.dev/schemas/2.2.6/schema.json", "$schema": "https://biomejs.dev/schemas/2.2.5/schema.json",
"vcs": { "vcs": {
"enabled": true, "enabled": true,
"clientKind": "git", "clientKind": "git",

View File

@ -9,6 +9,3 @@ slug: changelog/v0.34.5
* Add support for BigTIFF output. * Add support for BigTIFF output.
[#4459](https://github.com/lovell/sharp/pull/4459) [#4459](https://github.com/lovell/sharp/pull/4459)
[@throwbi](https://github.com/throwbi) [@throwbi](https://github.com/throwbi)
* Improve error messaging when only warnings issued.
[#4465](https://github.com/lovell/sharp/issues/4465)

View File

@ -140,8 +140,8 @@
], ],
"dependencies": { "dependencies": {
"@img/colour": "^1.0.0", "@img/colour": "^1.0.0",
"detect-libc": "^2.1.2", "detect-libc": "^2.1.1",
"semver": "^7.7.3" "semver": "^7.7.2"
}, },
"optionalDependencies": { "optionalDependencies": {
"@img/sharp-darwin-arm64": "0.34.4", "@img/sharp-darwin-arm64": "0.34.4",
@ -168,7 +168,7 @@
"@img/sharp-win32-x64": "0.34.4" "@img/sharp-win32-x64": "0.34.4"
}, },
"devDependencies": { "devDependencies": {
"@biomejs/biome": "^2.2.6", "@biomejs/biome": "^2.2.5",
"@cpplint/cli": "^0.1.0", "@cpplint/cli": "^0.1.0",
"@emnapi/runtime": "^1.5.0", "@emnapi/runtime": "^1.5.0",
"@img/sharp-libvips-dev": "1.2.3", "@img/sharp-libvips-dev": "1.2.3",
@ -183,7 +183,7 @@
"icc": "^3.0.0", "icc": "^3.0.0",
"jsdoc-to-markdown": "^9.1.3", "jsdoc-to-markdown": "^9.1.3",
"node-addon-api": "^8.5.0", "node-addon-api": "^8.5.0",
"node-gyp": "^11.5.0", "node-gyp": "^11.4.2",
"tar-fs": "^3.1.1", "tar-fs": "^3.1.1",
"tsd": "^0.33.0" "tsd": "^0.33.0"
}, },

View File

@ -1278,12 +1278,7 @@ class PipelineWorker : public Napi::AsyncWorker {
if (what && what[0]) { if (what && what[0]) {
(baton->err).append(what); (baton->err).append(what);
} else { } else {
if (baton->input->failOn == VIPS_FAIL_ON_WARNING) { (baton->err).append("Unknown error");
(baton->err).append("Warning treated as error due to failOn setting");
baton->errUseWarning = true;
} else {
(baton->err).append("Unknown error");
}
} }
} }
// Clean up libvips' per-request data and threads // Clean up libvips' per-request data and threads
@ -1298,11 +1293,7 @@ class PipelineWorker : public Napi::AsyncWorker {
// Handle warnings // Handle warnings
std::string warning = sharp::VipsWarningPop(); std::string warning = sharp::VipsWarningPop();
while (!warning.empty()) { while (!warning.empty()) {
if (baton->errUseWarning) { debuglog.Call(Receiver().Value(), { Napi::String::New(env, warning) });
(baton->err).append("\n").append(warning);
} else {
debuglog.Call(Receiver().Value(), { Napi::String::New(env, warning) });
}
warning = sharp::VipsWarningPop(); warning = sharp::VipsWarningPop();
} }

View File

@ -198,7 +198,6 @@ struct PipelineBaton {
bool jxlLossless; bool jxlLossless;
VipsBandFormat rawDepth; VipsBandFormat rawDepth;
std::string err; std::string err;
bool errUseWarning;
int keepMetadata; int keepMetadata;
int withMetadataOrientation; int withMetadataOrientation;
double withMetadataDensity; double withMetadataDensity;
@ -374,7 +373,6 @@ struct PipelineBaton {
jxlEffort(7), jxlEffort(7),
jxlLossless(false), jxlLossless(false),
rawDepth(VIPS_FORMAT_UCHAR), rawDepth(VIPS_FORMAT_UCHAR),
errUseWarning(false),
keepMetadata(0), keepMetadata(0),
withMetadataOrientation(-1), withMetadataOrientation(-1),
withMetadataDensity(0.0), withMetadataDensity(0.0),

Binary file not shown.

View File

@ -113,7 +113,6 @@ module.exports = {
inputTiff8BitDepth: getPath('8bit_depth.tiff'), inputTiff8BitDepth: getPath('8bit_depth.tiff'),
inputTifftagPhotoshop: getPath('tifftag-photoshop.tiff'), // https://github.com/lovell/sharp/issues/1600 inputTifftagPhotoshop: getPath('tifftag-photoshop.tiff'), // https://github.com/lovell/sharp/issues/1600
inputTiffFogra: getPath('fogra-0-100-100-0.tif'), // https://github.com/lovell/sharp/issues/4045 inputTiffFogra: getPath('fogra-0-100-100-0.tif'), // https://github.com/lovell/sharp/issues/4045
inputTiffGeo: getPath('bonne.geo.tif'), // https://download.osgeo.org/geotiff/samples/intergraph
inputJp2: getPath('relax.jp2'), // https://www.fnordware.com/j2k/relax.jp2 inputJp2: getPath('relax.jp2'), // https://www.fnordware.com/j2k/relax.jp2
inputJp2TileParts: getPath('relax_tileparts.jp2'), // kdu_expand -i relax.jp2 -o relax-tmp.tif ; kdu_compress -i relax-tmp.tif -o relax_tileparts.jp2 -jp2_space sRGB Clayers=8 -rate 1.0,0.04 Stiles='{128,128}' ORGtparts=L ; rm relax-tmp.tif inputJp2TileParts: getPath('relax_tileparts.jp2'), // kdu_expand -i relax.jp2 -o relax-tmp.tif ; kdu_compress -i relax-tmp.tif -o relax_tileparts.jp2 -jp2_space sRGB Clayers=8 -rate 1.0,0.04 Stiles='{128,128}' ORGtparts=L ; rm relax-tmp.tif

View File

@ -103,11 +103,4 @@ describe('failOn', () => {
fs.createReadStream(fixtures.inputJpgTruncated).pipe(writable); fs.createReadStream(fixtures.inputJpgTruncated).pipe(writable);
return writable.toBuffer(); return writable.toBuffer();
}); });
it('converts warnings to error for GeoTIFF', async () => {
await assert.rejects(
sharp(fixtures.inputTiffGeo).toBuffer(),
/Unknown field with tag 33550/
);
});
}); });