mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 18:06:18 +03:00
Merge pull request #3549 from radarhere/mimetype
Improved get_format_mimetype logic
This commit is contained in:
commit
58e60510e6
|
@ -120,9 +120,10 @@ class ImageFile(Image.Image):
|
|||
pass
|
||||
|
||||
def get_format_mimetype(self):
|
||||
if self.format is None:
|
||||
return
|
||||
return self.custom_mimetype or Image.MIME.get(self.format.upper())
|
||||
if self.custom_mimetype:
|
||||
return self.custom_mimetype
|
||||
if self.format is not None:
|
||||
return Image.MIME.get(self.format.upper())
|
||||
|
||||
def verify(self):
|
||||
"""Check file integrity"""
|
||||
|
|
Loading…
Reference in New Issue
Block a user