Skip to content

Commit 933f21c

Browse files
authored
gh-85957: Add missing MIME types for images with RFCs (#126966)
1 parent f7ef020 commit 933f21c

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

Doc/whatsnew/3.14.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,17 @@ mimetypes
396396

397397
(Contributed by Hugo van Kemenade in :gh:`89416`.)
398398

399+
* Add MIME types for images with RFCs:
400+
401+
* :rfc:`1494`: CCITT Group 3 (``.g3``)
402+
* :rfc:`3362`: Real-time Facsimile, T.38 (``.t38``)
403+
* :rfc:`3745`: JPEG 2000 (``.jp2``), extension (``.jpx``) and compound (``.jpm``)
404+
* :rfc:`3950`: Tag Image File Format Fax eXtended, TIFF-FX (``.tfx``)
405+
* :rfc:`4047`: Flexible Image Transport System (``.fits``)
406+
* :rfc:`7903`: Enhanced Metafile (``.emf``) and Windows Metafile (``.wmf``)
407+
408+
(Contributed by Hugo van Kemenade in :gh:`85957`.)
409+
399410

400411
multiprocessing
401412
---------------

Lib/mimetypes.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,19 +550,28 @@ def _default_mime_types():
550550
'.woff2' : 'font/woff2',
551551
'.avif' : 'image/avif',
552552
'.bmp' : 'image/bmp',
553+
'.emf' : 'image/emf',
554+
'.fits' : 'image/fits',
555+
'.g3' : 'image/g3fax',
553556
'.gif' : 'image/gif',
554557
'.ief' : 'image/ief',
558+
'.jp2' : 'image/jp2',
555559
'.jpg' : 'image/jpeg',
556560
'.jpe' : 'image/jpeg',
557561
'.jpeg' : 'image/jpeg',
562+
'.jpm' : 'image/jpm',
563+
'.jpx' : 'image/jpx',
558564
'.heic' : 'image/heic',
559565
'.heif' : 'image/heif',
560566
'.png' : 'image/png',
561567
'.svg' : 'image/svg+xml',
568+
'.t38' : 'image/t38',
562569
'.tiff' : 'image/tiff',
563570
'.tif' : 'image/tiff',
571+
'.tfx' : 'image/tiff-fx',
564572
'.ico' : 'image/vnd.microsoft.icon',
565573
'.webp' : 'image/webp',
574+
'.wmf' : 'image/wmf',
566575
'.ras' : 'image/x-cmu-raster',
567576
'.pnm' : 'image/x-portable-anymap',
568577
'.pbm' : 'image/x-portable-bitmap',

Lib/test/test_mimetypes.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,17 @@ def check_extensions():
240240
("font/woff", ".woff"),
241241
("font/woff2", ".woff2"),
242242
("image/avif", ".avif"),
243+
("image/emf", ".emf"),
244+
("image/fits", ".fits"),
245+
("image/g3fax", ".g3"),
246+
("image/jp2", ".jp2"),
247+
("image/jpm", ".jpm"),
248+
("image/t38", ".t38"),
243249
("image/webp", ".webp"),
250+
("image/wmf", ".wmf"),
244251
("image/jpeg", ".jpg"),
245252
("image/tiff", ".tiff"),
253+
("image/tiff-fx", ".tfx"),
246254
("message/rfc822", ".eml"),
247255
("text/html", ".html"),
248256
("text/plain", ".txt"),
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Add missing MIME types for images with RFCs: emf, fits, g3fax, jp2, jpm,
2+
jpx, t38, tiff-fx and wmf. Patch by Hugo van Kemenade.

0 commit comments

Comments
 (0)