From 1f73a16ef36d1a8e771a0b3695818d18e095486b Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sat, 14 Jan 2023 15:38:12 +0100 Subject: [PATCH] imghdr is deprecated --- libmat2/images.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/libmat2/images.py b/libmat2/images.py index 37ed36c..083ff64 100644 --- a/libmat2/images.py +++ b/libmat2/images.py @@ -1,4 +1,3 @@ -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: