[Python-checkins] bpo-43542: Add heif/heic formats in mimetypes (GH-24917)

gpshead webhook-mailer at python.org
Sat Mar 20 19:06:33 EDT 2021

commit: 20a5b7e986377bdfd929d7e8c4e3db5847dfdb2d
branch: master
author: Ilya Stepin <stepinilya at gmail.com>
committer: gpshead <greg at krypto.org>
date: 2021-03-20T16:06:27-07:00

bpo-43542: Add heif/heic formats in mimetypes (GH-24917)

* bpo-43542: Add heif/heic formats in mimetypes

Add HEIF and HEIC format to list of media types. It has IANA registration.

IANA: https://www.iana.org/assignments/media-types/image/heic
HEIF Github: https://github.com/nokiatech/heif

Co-authored-by: Gregory P. Smith <greg at krypto.org>

A Misc/NEWS.d/next/Library/2021-03-20-15-43-25.bpo-43542.6bt2F6.rst
M Lib/mimetypes.py

diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py
index d2c8ac76dcc08..018793c4f01e4 100644
--- a/Lib/mimetypes.py
+++ b/Lib/mimetypes.py
@@ -505,6 +505,8 @@ def _default_mime_types():
         '.jpg'    : 'image/jpeg',
         '.jpe'    : 'image/jpeg',
         '.jpeg'   : 'image/jpeg',
+        '.heic'   : 'image/heic',
+        '.heif'   : 'image/heif',
         '.png'    : 'image/png',
         '.svg'    : 'image/svg+xml',
         '.tiff'   : 'image/tiff',
diff --git a/Misc/NEWS.d/next/Library/2021-03-20-15-43-25.bpo-43542.6bt2F6.rst b/Misc/NEWS.d/next/Library/2021-03-20-15-43-25.bpo-43542.6bt2F6.rst
new file mode 100644
index 0000000000000..370e520ca3e06
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2021-03-20-15-43-25.bpo-43542.6bt2F6.rst
@@ -0,0 +1 @@
+``image/heic`` and ``image/heif`` were added to :mod:`mimetypes`.

More information about the Python-checkins mailing list