This commit is contained in:
Kovid Goyal 2013-04-11 22:49:33 +05:30
parent da8d7034ae
commit e74a1f562b

View File

@ -39,7 +39,7 @@ def test_jpeg(h, f):
"""JPEG data in JFIF format (Changed by Kovid to mimic the file utility, """JPEG data in JFIF format (Changed by Kovid to mimic the file utility,
the original code was failing with some jpegs that included ICC_PROFILE the original code was failing with some jpegs that included ICC_PROFILE
data, for example: http://nationalpostnews.files.wordpress.com/2013/03/budget.jpeg?w=300&h=1571)""" data, for example: http://nationalpostnews.files.wordpress.com/2013/03/budget.jpeg?w=300&h=1571)"""
if (h[6:10] in (b'JFIF', b'Exif')) or (h[:2] == b'\xff\xd8' and (b'JFIF' in h[:32] or b'BIM' in h[:32])): if (h[6:10] in (b'JFIF', b'Exif')) or (h[:2] == b'\xff\xd8' and (b'JFIF' in h[:32] or b'8BIM' in h[:32])):
return 'jpeg' return 'jpeg'
tests.append(test_jpeg) tests.append(test_jpeg)