I am trying to read data from a jpg file using the open() function in python. For some reason, some of the file data is being lost. Here is what I tried:
file = open(imageDir, 'r')
data = file.read()
print data
When I try to re-write the data into a new file, the new file is corrupt.