Skip to content

Instantly share code, notes, and snippets.

@bennyyip
Created September 26, 2019 02:59
Show Gist options
  • Select an option

  • Save bennyyip/6845d7b09ff41bb854f2a43430f2a09c to your computer and use it in GitHub Desktop.

Select an option

Save bennyyip/6845d7b09ff41bb854f2a43430f2a09c to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import sys
import os
jpg = sys.argv[1]
with open(jpg, "rb") as f:
b = f.read()
start_of_archive = b.find(b"\xff\xd9") + 2
out_fname = os.path.splitext(jpg)[0] + ".zip"
with open(out_fname, "wb") as f:
f.write(b[start_of_archive:])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment