Created
November 5, 2013 08:53
-
-
Save lucemia/7315857 to your computer and use it in GitHub Desktop.
vip extractor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
def extract_jpg(ifilepath): | |
ofile = 'test.jpg' | |
with open(ifilepath, 'rb') as ifile: | |
icontent = ifile.read() | |
index = icontent.index("</panorama>") + len("</panorama>") | |
# print index | |
icontent = icontent[index:] | |
with open(ofile, 'wb') as ofile: | |
ofile.write(icontent) | |
if __name__ == "__main__": | |
print sys.argv[1] | |
extract_jpg(sys.argv[1]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment