Last active
August 14, 2020 17:34
-
-
Save smtchahal/893e88fa9a778f559fe73c2a6ef1764e to your computer and use it in GitHub Desktop.
Revisions
-
smtchahal revised this gist
Mar 23, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -25,7 +25,7 @@ def main(): if os.path.isfile(name): convert(name) else: print('WARNING: {} is not a file'.format(name), file=sys.stderr) if __name__ == '__main__': -
smtchahal revised this gist
Mar 3, 2018 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
Empty file. -
smtchahal revised this gist
Mar 3, 2018 . No changes.There are no files selected for viewing
-
smtchahal created this gist
Mar 3, 2018 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,32 @@ #!/usr/bin/env python3 # Converts GTA V's snapmatic files to JPG files. # It basically removes the first 292 bytes from the file. # # Usage: python3 convert.py file1 file2 file3... # # Output is stored as file1.jpg, file2.jpg, file3.jpg # in the same directory. import os import sys OFFSET = 292 def convert(name): with open(name, 'rb') as in_file: with open(name + '.jpg', 'wb') as out_file: out_file.write(in_file.read()[OFFSET:]) def main(): for name in sys.argv[1:]: if os.path.isfile(name): convert(name) else: print('WARNING: {} is not a file'.format(name), file=sys.stdout) if __name__ == '__main__': main()