Alexander Demidov
11 years ago
5 changed files with 46 additions and 40 deletions
-
BINcrop.jpg
-
52resize.py
-
13square.py
-
11test_resize.sh
-
BINthumbnail.jpg
Before Width: 100 | Height: 100 | Size: 13 KiB |
@ -1,13 +0,0 @@ |
|||
#!/usr/bin/env python |
|||
import argparse |
|||
parser = argparse.ArgumentParser() |
|||
parser.add_argument("square", type=int, |
|||
help="display a square of a given number") |
|||
parser.add_argument("-v", "--verbose", action="store_true", |
|||
help="increase output verbosity") |
|||
args = parser.parse_args() |
|||
answer = args.square**2 |
|||
if args.verbose: |
|||
print("the square of {} equals {}".format(args.square, answer)) |
|||
else: |
|||
print(answer) |
@ -0,0 +1,11 @@ |
|||
#!/bin/sh |
|||
./resize.py --width=100 origin.jpg resize_w100.jpg |
|||
./resize.py --width=100 --crop default origin.jpg resize_w100_crop.jpg |
|||
./resize.py --width=100 --crop whitespace origin.jpg resize_w100_crop_whitespace.jpg |
|||
./resize.py --height=100 origin.jpg resize_h100.jpg |
|||
./resize.py --height=100 --crop default origin.jpg resize_h100_crop.jpg |
|||
./resize.py --height=100 --crop whitespace origin.jpg resize_h100_crop_whitespace.jpg |
|||
./resize.py --width=100 --height=100 origin.jpg resize_w100_h100.jpg |
|||
./resize.py --width=100 --height=100 --crop default origin.jpg resize_w100_h100_crop.jpg |
|||
./resize.py --width=100 --height=100 --crop whitespace origin.jpg resize_w100_h100_crop_whitespace.jpg |
|||
./resize.py --enhance origin.jpg enhance.jpg |
Before Width: 100 | Height: 100 | Size: 10 KiB |
Write
Preview
Loading…
Cancel
Save
Reference in new issue