I need to find the size of a JPEG (JFIF) image. The image is not saved as a stand-alone file, so I can\'t use GetFileSize
or any other API such this one (the im
In python, you could just read the whole file into a string object and find the first occurrence of FF E0 and the last occurrence of FF D9. Presumably, these are the start and end that you are looking for?
f = open("filename.jpg", "r")
s = f.read()
start = s.find("\xff\xe0")
end = s.rfind("\xff\xd9")
imagesize = end - start