Skip to content

gh-85957: Add missing MIME types for images with RFCs #126966

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Doc/whatsnew/3.14.rst
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,17 @@ mimetypes

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

* Add MIME types for images with RFCs:

* :rfc:`1494`: CCITT Group 3 (``.g3``)
* :rfc:`3362`: Real-time Facsimile, T.38 (``.t38``)
* :rfc:`3745`: JPEG 2000 (``.jp2``), extension (``.jpx``) and compound (``.jpm``)
* :rfc:`3950`: Tag Image File Format Fax eXtended, TIFF-FX (``.tfx``)
* :rfc:`4047`: Flexible Image Transport System (``.fits``)
* :rfc:`7903`: Enhanced Metafile (``.emf``) and Windows Metafile (``.wmf``)

(Contributed by Hugo van Kemenade in :gh:`85957`.)


multiprocessing
---------------
Expand Down
9 changes: 9 additions & 0 deletions Lib/mimetypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,19 +550,28 @@ def _default_mime_types():
'.woff2' : 'font/woff2',
'.avif' : 'image/avif',
'.bmp' : 'image/bmp',
'.emf' : 'image/emf',
'.fits' : 'image/fits',
'.g3' : 'image/g3fax',
'.gif' : 'image/gif',
'.ief' : 'image/ief',
'.jp2' : 'image/jp2',
'.jpg' : 'image/jpeg',
'.jpe' : 'image/jpeg',
'.jpeg' : 'image/jpeg',
'.jpm' : 'image/jpm',
'.jpx' : 'image/jpx',
'.heic' : 'image/heic',
'.heif' : 'image/heif',
'.png' : 'image/png',
'.svg' : 'image/svg+xml',
'.t38' : 'image/t38',
'.tiff' : 'image/tiff',
'.tif' : 'image/tiff',
'.tfx' : 'image/tiff-fx',
'.ico' : 'image/vnd.microsoft.icon',
'.webp' : 'image/webp',
'.wmf' : 'image/wmf',
'.ras' : 'image/x-cmu-raster',
'.pnm' : 'image/x-portable-anymap',
'.pbm' : 'image/x-portable-bitmap',
Expand Down
8 changes: 8 additions & 0 deletions Lib/test/test_mimetypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,17 @@ def check_extensions():
("font/woff", ".woff"),
("font/woff2", ".woff2"),
("image/avif", ".avif"),
("image/emf", ".emf"),
("image/fits", ".fits"),
("image/g3fax", ".g3"),
("image/jp2", ".jp2"),
("image/jpm", ".jpm"),
("image/t38", ".t38"),
("image/webp", ".webp"),
("image/wmf", ".wmf"),
("image/jpeg", ".jpg"),
("image/tiff", ".tiff"),
("image/tiff-fx", ".tfx"),
("message/rfc822", ".eml"),
("text/html", ".html"),
("text/plain", ".txt"),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Add missing MIME types for images with RFCs: emf, fits, g3fax, jp2, jpm,
jpx, t38, tiff-fx and wmf. Patch by Hugo van Kemenade.
Loading