Skip to content

Instantly share code, notes, and snippets.

@lucemia
Created November 5, 2013 08:53
Show Gist options
  • Save lucemia/7315857 to your computer and use it in GitHub Desktop.
Save lucemia/7315857 to your computer and use it in GitHub Desktop.
vip extractor
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