Quote:
Originally Posted by KevinH
I am not sure what your concern here is. A file is only created if it is a known image type. The remaining code in the loop simply invokes imghdr which just looks at select bytes strings near the front of the data string (very much like what you are doing, so it should be very fast) and then appends an placeholder to a list. Nothing here will impact processing time much if at all versus your version.
|
My concern wasn't speed but that it's not very elegant to search for image headers in sections already known to not contain images.
Quote:
As Paul indicated, this may not be the case so this version is safer.
|
I would consider such files to be broken, especially if the additional image sections occur after the EOF-section. But if such file exists we should be able to decode them, of course.
So I've changed the code to skip non-image sections again but still work for such broken files.
Ciao,
Steffen