mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
Correctly identify JPEG files that have no headers
This commit is contained in:
parent
93e68b1398
commit
ce4d12711a
@ -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
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user