From 1f55caf97e0906f2b8b693b01d3d6073df8187c1 Mon Sep 17 00:00:00 2001 From: FooIbar <118464521+FooIbar@users.noreply.github.com> Date: Mon, 26 Jan 2026 22:26:55 +0800 Subject: [PATCH] gh-144212: Add `image/jxl` to `mimetypes` (GH-144213) --- Doc/whatsnew/3.15.rst | 1 + Lib/mimetypes.py | 1 + Lib/test/test_mimetypes.py | 1 + .../next/Library/2026-01-24-23-11-17.gh-issue-144212.IXqVL8.rst | 1 + 4 files changed, 4 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2026-01-24-23-11-17.gh-issue-144212.IXqVL8.rst diff --git a/Doc/whatsnew/3.15.rst b/Doc/whatsnew/3.15.rst index c412f48606c0..aec6b1ceea37 100644 --- a/Doc/whatsnew/3.15.rst +++ b/Doc/whatsnew/3.15.rst @@ -606,6 +606,7 @@ mimetypes * Add ``application/dicom`` MIME type for ``.dcm`` extension. (Contributed by Benedikt Johannes in :gh:`144217`.) * Add ``application/node`` MIME type for ``.cjs`` extension. (Contributed by John Franey in :gh:`140937`.) * Add ``application/toml``. (Contributed by Gil Forcada in :gh:`139959`.) +* Add ``image/jxl``. (Contributed by Foolbar in :gh:`144213`.) * Rename ``application/x-texinfo`` to ``application/texinfo``. (Contributed by Charlie Lin in :gh:`140165`.) * Changed the MIME type for ``.ai`` files to ``application/pdf``. diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py index 361f924b55da..fc916c470a01 100644 --- a/Lib/mimetypes.py +++ b/Lib/mimetypes.py @@ -609,6 +609,7 @@ def _default_mime_types(): '.jpeg' : 'image/jpeg', '.jpm' : 'image/jpm', '.jpx' : 'image/jpx', + '.jxl' : 'image/jxl', '.heic' : 'image/heic', '.heif' : 'image/heif', '.png' : 'image/png', diff --git a/Lib/test/test_mimetypes.py b/Lib/test/test_mimetypes.py index 32adc5935910..fe7584f1f9d3 100644 --- a/Lib/test/test_mimetypes.py +++ b/Lib/test/test_mimetypes.py @@ -271,6 +271,7 @@ class MimeTypesTestCase(unittest.TestCase): ("image/jp2", ".jp2"), ("image/jpeg", ".jpg"), ("image/jpm", ".jpm"), + ("image/jxl", ".jxl"), ("image/t38", ".t38"), ("image/tiff", ".tiff"), ("image/tiff-fx", ".tfx"), diff --git a/Misc/NEWS.d/next/Library/2026-01-24-23-11-17.gh-issue-144212.IXqVL8.rst b/Misc/NEWS.d/next/Library/2026-01-24-23-11-17.gh-issue-144212.IXqVL8.rst new file mode 100644 index 000000000000..be77fb345ada --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-01-24-23-11-17.gh-issue-144212.IXqVL8.rst @@ -0,0 +1 @@ +Mime type ``image/jxl`` is now supported by :mod:`mimetypes`. -- 2.47.3