From eb61c1bae2ffad114e17393d91d86fb00d7ac8cd Mon Sep 17 00:00:00 2001 From: Hannah Isopod Date: Sat, 10 May 2025 03:03:58 -0600 Subject: Initialer commit Just remade the repo because I don't *need* need a comprehensive source history for my personal website and this is easier than getting filter-repo to work good --- stuff/webpkiller/webpkiller.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 stuff/webpkiller/webpkiller.py (limited to 'stuff/webpkiller/webpkiller.py') diff --git a/stuff/webpkiller/webpkiller.py b/stuff/webpkiller/webpkiller.py new file mode 100644 index 0000000..0153ff7 --- /dev/null +++ b/stuff/webpkiller/webpkiller.py @@ -0,0 +1,27 @@ +import PIL as pillow +from PIL import Image +import subprocess, os, platform, sys + +infile = sys.argv[len(sys.argv)-1] +outfile = infile[:infile.rfind('.')] + ".png" + +if(os.path.exists(infile) == False): + print("File %s not found. Aborting..." %infile) + exit() + +if(os.path.exists(outfile)): + print("File %s already exists. Aborting..." %outfile) + exit() + +im = Image.open(infile) + +im.save(outfile) + +os.remove(infile) + +if(platform.system() == 'Darwin'): # macOS + subprocess.call(('open', outfile)) +elif(platform.system() == 'Windows'): # Windows + os.startfile(outfile) +else: # linux variants + subprocess.call(('xdg-open', outfile)) \ No newline at end of file -- cgit v1.2.3