Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
mat2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jvoisin
mat2
Commits
1f73a16e
Commit
1f73a16e
authored
2 years ago
by
Julien (jvoisin) Voisin
Browse files
Options
Downloads
Patches
Plain Diff
imghdr is deprecated
parent
e8b38f11
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#126007
passed with warnings
2 years ago
Stage: linting
Stage: test
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libmat2/images.py
+0
-5
0 additions, 5 deletions
libmat2/images.py
with
0 additions
and
5 deletions
libmat2/images.py
+
0
−
5
View file @
1f73a16e
import
imghdr
import
os
import
re
from
typing
import
Union
,
Any
...
...
@@ -71,9 +70,6 @@ class PNGParser(exiftool.ExiftoolParser):
def
__init__
(
self
,
filename
):
super
().
__init__
(
filename
)
if
imghdr
.
what
(
filename
)
!=
'
png
'
:
raise
ValueError
try
:
# better fail here than later
cairo
.
ImageSurface
.
create_from_png
(
self
.
filename
)
except
:
# pragma: no cover
...
...
@@ -111,7 +107,6 @@ class GdkPixbufAbstractParser(exiftool.ExiftoolParser):
def
__init__
(
self
,
filename
):
super
().
__init__
(
filename
)
# we can't use imghdr here because of https://bugs.python.org/issue28591
try
:
GdkPixbuf
.
Pixbuf
.
new_from_file
(
self
.
filename
)
except
GLib
.
GError
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment