View Single Post
Old 07-17-2013, 12:44 AM   #553
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
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?

Last edited by NiLuJe; 07-17-2013 at 12:49 AM.
NiLuJe is offline   Reply With Quote