Apply review

This commit is contained in:
Simon Sawicki 2024-06-24 00:53:07 +02:00
parent 3383c909ea
commit 7f54596d66
No known key found for this signature in database
1 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,8 @@
def what(file=None, h=None):
""" Detect format of image (Currently supports jpeg, png, webp, gif only) """
"""Detect format of image (Currently supports jpeg, png, webp, gif only)
Ref: https://github.com/python/cpython/blob/3.11/Lib/imghdr.py
Ref: https://www.w3.org/Graphics/JPEG/itu-t81.pdf
"""
if h is None:
with open(file, 'rb') as f:
h = f.read(12)