Created
September 26, 2019 02:59
-
-
Save bennyyip/6845d7b09ff41bb854f2a43430f2a09c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #!/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