Created
December 25, 2015 03:27
-
-
Save killown/147ed1867d43381115b7 to your computer and use it in GitHub Desktop.
thunar resize image
This file contains 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 characters
from easygui import * | |
import sys | |
import os | |
from PIL import Image | |
size = enterbox(msg='Enter the image size, example: 800x600', title=' ', default='', strip=True) | |
filename = sys.argv[-1] | |
width = size.split('x')[0] | |
height = size.split('x')[1] | |
img = Image.open(os.path.join(directory, image)) | |
img = img.resize((width, height), Image.BILINEAR) | |
image = os.path.split(filename)[-1] | |
img.save(os.path.join('resized-' + image)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment