Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
2f60820f
Commit
2f60820f
authored
Jun 26, 2014
by
R David Murray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#20295: Teach imghdr to recognize OpenEXR format images.
Patch by Martin Vignali, test by Claudiu Popa.
parent
a157867a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
0 deletions
+20
-0
Doc/library/imghdr.rst
Doc/library/imghdr.rst
+5
-0
Doc/whatsnew/3.5.rst
Doc/whatsnew/3.5.rst
+6
-0
Lib/imghdr.py
Lib/imghdr.py
+6
-0
Lib/test/imghdrdata/python.exr
Lib/test/imghdrdata/python.exr
+0
-0
Lib/test/test_imghdr.py
Lib/test/test_imghdr.py
+1
-0
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Doc/library/imghdr.rst
View file @
2f60820f
...
...
@@ -50,6 +50,11 @@ from :func:`what`:
+------------+-----------------------------------+
| ``'webp'`` | WebP files |
+------------+-----------------------------------+
| ``'exr'`` | OpenEXR Files |
+------------+-----------------------------------+
.. versionadded:: 3.5
The *exr* format was added.
.. versionchanged:: 3.5
The *webp* type was added.
...
...
Doc/whatsnew/3.5.rst
View file @
2f60820f
...
...
@@ -141,6 +141,12 @@ doctest
*module* contains no docstrings instead of raising :exc:`ValueError`
(contributed by Glenn Jones in :issue:`15916`).
imghdr
------
* :func:`~imghdr.what` now recognizes the `OpenEXR <http://www.openexr.com>`_
format (contributed by Martin vignali and Cladui Popa in :issue:`20295`).
importlib
---------
...
...
Lib/imghdr.py
View file @
2f60820f
...
...
@@ -116,6 +116,12 @@ def test_webp(h, f):
tests
.
append
(
test_webp
)
def
test_exr
(
h
,
f
):
if
h
.
startswith
(
b'
\
x76
\
x2f
\
x31
\
x01
'
):
return
'exr'
tests
.
append
(
test_exr
)
#--------------------#
# Small test program #
#--------------------#
...
...
Lib/test/imghdrdata/python.exr
0 → 100644
View file @
2f60820f
File added
Lib/test/test_imghdr.py
View file @
2f60820f
...
...
@@ -18,6 +18,7 @@ TEST_FILES = (
(
'python.tiff'
,
'tiff'
),
(
'python.xbm'
,
'xbm'
),
(
'python.webp'
,
'webp'
),
(
'python.exr'
,
'exr'
),
)
class
UnseekableIO
(
io
.
FileIO
):
...
...
Misc/NEWS
View file @
2f60820f
...
...
@@ -103,6 +103,8 @@ Core and Builtins
Library
-------
- Issue #20295: imghdr now recognizes OpenEXR format images.
- Issue #21729: Used the "with" statement in the dbm.dumb module to ensure
files closing. Patch by Claudiu Popa.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment