From 0150776dcabdd2db1929c4d158bb5423b9c6a47e Mon Sep 17 00:00:00 2001 From: solonovamax Date: Mon, 18 Nov 2024 12:36:55 -0500 Subject: [PATCH 1/3] Support JPEG XL image converter Fixes #10003 --- packages/transformers/image/src/ImageTransformer.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/transformers/image/src/ImageTransformer.js b/packages/transformers/image/src/ImageTransformer.js index 46eb5404ff9..3c8a1ed47ad 100644 --- a/packages/transformers/image/src/ImageTransformer.js +++ b/packages/transformers/image/src/ImageTransformer.js @@ -16,6 +16,8 @@ const FORMATS = new Map([ ['avif', 'avif'], ['heic', 'heif'], ['heif', 'heif'], + ['jpegxl', 'jxl'], + ['jxl', 'jxl'], ]); let isSharpLoadedOnMainThread = false; From 0477fb5c658a4c0c02ee6d18235b8e6a920d9c5c Mon Sep 17 00:00:00 2001 From: solonovamax Date: Mon, 18 Nov 2024 12:41:12 -0500 Subject: [PATCH 2/3] Add test for JPEG XL --- .../integration-tests/test/integration/image/reformat-all.html | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/core/integration-tests/test/integration/image/reformat-all.html b/packages/core/integration-tests/test/integration/image/reformat-all.html index cdfaf402cd7..fc25f2daece 100644 --- a/packages/core/integration-tests/test/integration/image/reformat-all.html +++ b/packages/core/integration-tests/test/integration/image/reformat-all.html @@ -1,5 +1,6 @@ ​ + From c10287f5e647d5e941d642fa10a87ef9ef605dd2 Mon Sep 17 00:00:00 2001 From: solonovamax Date: Mon, 18 Nov 2024 13:25:23 -0500 Subject: [PATCH 3/3] Fix integration tests --- packages/core/integration-tests/test/image.js | 2 +- .../integration-tests/test/integration/image/reformat-all.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/integration-tests/test/image.js b/packages/core/integration-tests/test/image.js index 0f9ec98cc26..1404dbfd7a9 100644 --- a/packages/core/integration-tests/test/image.js +++ b/packages/core/integration-tests/test/image.js @@ -85,7 +85,7 @@ describe('image', function () { assert.deepStrictEqual( foundExtensions, - new Set(['html', 'webp', 'avif', 'jpeg', 'png', 'tiff']), + new Set(['html', 'webp', 'avif', 'jpeg', 'jxl', 'png', 'tiff']), ); }); }); diff --git a/packages/core/integration-tests/test/integration/image/reformat-all.html b/packages/core/integration-tests/test/integration/image/reformat-all.html index fc25f2daece..01d7b6bfb11 100644 --- a/packages/core/integration-tests/test/integration/image/reformat-all.html +++ b/packages/core/integration-tests/test/integration/image/reformat-all.html @@ -1,7 +1,7 @@ ​ - +