4 ms·
There's a 256byte limit for #! so this shouldn't work at all. EDIT: Now I see its badly formatted, Either way, be careful with #! size limits.
by nmz 3y ago
There's a 256byte limit for #! so this shouldn't work at all.
EDIT: Now I see its badly formatted, Either way, be careful with #! size limits.
- pronoiac 3y agoAh. I think two leading spaces fix this? I'll try: #! /usr/bin/env nix-shell #! nix-shell -i python3 -p python3Packages.pillow python3Packages.ansicolor # scale image by 50% import sys, PIL.Image, ansicolor path = sys.argv[1] image = PIL.Image.open(path) factor = 0.5 image = image.resize((round(image.width \* factor), round(image.height \* factor))) path = path + ".s50.jpg" image.save(path) print(ansicolor.green(f"done {path}"))