Added image tools for ui redesign.

This commit is contained in:
Joey Payne 2015-04-02 20:34:32 -06:00
commit 70bce8cc49
2 changed files with 26 additions and 0 deletions

2
image_tool_build.bash Executable file
View file

@ -0,0 +1,2 @@
rm -rf image_tool_builds
pyinstaller --onefile --distpath image_tool_builds -n imgtools_linux image_tools.py

24
image_tools.py Normal file
View file

@ -0,0 +1,24 @@
from pepy.pe import PEFile
from pycns import save_icns
import sys
if __name__ == '__main__':
if len(sys.argv) < 4 or len(sys.argv) > 5:
print ('image_tools <command> <args>\n'
' commands: save_icns input_file output_file\n'
' replace_icon input_exe icon_path [output_path]')
sys.exit()
command = sys.argv[1]
file1, file2 = sys.argv[2:4]
output_path = file1
if len(sys.argv) == 5:
output_path = sys.argv[4]
if command == 'save_icns':
save_icns(file1, file2)
elif command == 'replace_icon':
p = PEFile(file1)
p.replace_icon(file2)
p.write(output_path)