Kovid Goyal added the comment: FYI, the test I currently use in calibre, which has not failed so far for millions of users:
def test_jpeg(h, f): 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' ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue16512> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com