Skip to content

Instantly share code, notes, and snippets.

@whitead
Created May 14, 2013 02:04
recover photos snippet 1
#!/usr/bin/python
import sys
#open the tec file (first command line argument) in binary mode
fin = open(sys.argv[1], 'rb')
#open the jpg file for output (second command line argument) in binary mode
fout = open(sys.argv[2], 'wb')
#Read in the file
data = fin.read()
#The important part: remove the first 8 bytes and remove the last byte
fout.write(data[6:-1])
#close the file
fin.close()
fout.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment