Skip to content

Instantly share code, notes, and snippets.

@killown
Created December 25, 2015 03:27
Show Gist options
  • Save killown/147ed1867d43381115b7 to your computer and use it in GitHub Desktop.
Save killown/147ed1867d43381115b7 to your computer and use it in GitHub Desktop.
thunar resize image
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