diff --git a/src/calibre/utils/imghdr.py b/src/calibre/utils/imghdr.py index c899a5be95..c4070f072e 100644 --- a/src/calibre/utils/imghdr.py +++ b/src/calibre/utils/imghdr.py @@ -26,6 +26,10 @@ def what(file, h=None): finally: if f: f.close() + # There exist some jpeg files with no headers, only the starting two bits + # If we cannot identify as anything else, identify as jpeg. + if h[:2] == b'\xff\xd8': + return 'jpeg' return None