mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -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:
|
finally:
|
||||||
if f:
|
if f:
|
||||||
f.close()
|
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
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user