Added command-line utility. Refactored code to accomodate.
This commit is contained in:
parent
8d3397f8b1
commit
f7fa4cb6b6
9 changed files with 1261 additions and 865 deletions
|
|
@ -1,6 +1,7 @@
|
|||
from cStringIO import StringIO
|
||||
try:
|
||||
from PIL import Image as im
|
||||
IMAGE_UTILS_AVAILABLE = True
|
||||
Image = im.open
|
||||
def resize(image, size):
|
||||
output = StringIO()
|
||||
|
|
@ -17,7 +18,7 @@ try:
|
|||
output.close()
|
||||
return contents
|
||||
except ImportError:
|
||||
raise Exception('Python image library PIL/pillow is required.')
|
||||
IMAGE_UTILS_AVAILABLE = False
|
||||
|
||||
LARGEST_ICON_SIZE = 1024
|
||||
SMALLEST_ICON_SIZE = 16
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue