You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have at least one jpeg image, where elif imghdr.what(fname) returned None. Since there's a try-except clause with an empty return value anyway, it wouldn't hurt to add at least or imghdr.what(fname) == None: to that condition. I would assume that most images are jpeg, so it should cover most of the cases like mine.
I've replaced the code with a much simpler solution. Pytest suite passes. This is better anyway, using the already included PyMuPDF library, and the native imghdr module is deprecated.
Let me know if your jpeg still causes this code to stumble. Thanks!
https://docs.python.org/3/library/imghdr.html (deprecated; good until Python 3.13)
filetype:
https://pypi.org/project/filetype/#supported-types
Rationale:
we need to determine the size of images.
The text was updated successfully, but these errors were encountered: