Improve detection of jp2 filename extensions #3674

This commit is contained in:
BJJ
2023-05-20 19:12:01 +08:00
committed by Lovell Fuller
parent f5845c7e61
commit 7e6a70af44
2 changed files with 9 additions and 2 deletions

View File

@@ -25,6 +25,13 @@ describe('JP2 output', () => {
/JP2 output requires libvips with support for OpenJPEG/
)
);
it('File with JP2-like suffix should not fail due to missing OpenJPEG', () => {
const output = fixtures.path('output.failj2c');
return assert.doesNotReject(
async () => sharp(fixtures.inputPngWithOneColor).toFile(output)
);
});
} else {
it('JP2 Buffer to PNG Buffer', () => {
sharp(fs.readFileSync(fixtures.inputJp2))