Hello again!
I'm still using a stripped down KindleUnpack in the Kindle ScreenSavers hack, and one user just ran into a weird thing: a JPEG file with no EXIF or JFIF header, used as the cover.
imghdr doesn't handle those, so it gets discarded as an unknown resource. FWIW, GIMP chokes on it too, but ImageMagick handles it fine. Since I'm using IM, I amended the imghdr check with another one, right after:
Code:
# imghdr only checks for JFIF or Exif JPEG files. Apparently, there are some with only the magic JPEG bytes out there... ImageMagick handle those, so, do it too.
if imgtype is None and data[0:2] == chr(0xFF) + chr(0xD8):
imgtype = "jpeg"
Has anyone ever encountered JPEG files like that before?