I'm trying to learn more about exif data contained within a photo. What I don't understand is why I get the result from the following code:
file = open("IMG.JPG", "rb")
print(file.read(2))
print(file.read(2))
Gives me a result of:
>>>
b'\xff\xd8'
b'\xff\xe1'
Why are they different? The first result line makes sense, FFD8 represent that its a jpeg.
It is because each time you call file.read(x) it reads the next x items, not the first x items.