«   2019/04   »
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30        
Archives
Today
5
Total
1,207,440
안정적인 DNS서비스 DNSEver
관리 메뉴

Blue Breeze

library Pillow - thumbnail create 본문

Language/Python

library Pillow - thumbnail create

푸른바람 C/H 2019.01.23 08:30

Create JPEG thumbnails
from __future__ import print_function
import os, sys
from PIL import Image

size = (128, 128)

for infile in sys.argv[1:]:
	outfile = os.path.splitext(infile)[0] + ".thumbnail"
	if infile != outfile:
		try:
			im = Image.open(infile)
			im.thumbnail(size)
			im.save(outfile, "JPEG")
		except IOError:
			print("cannot create thumbnail for", infile)


'Language > Python' 카테고리의 다른 글

library Tesseract - OCR test  (0) 2019.01.25
library Tesseract - OCR  (0) 2019.01.24
library Pillow - thumbnail create  (0) 2019.01.23
library requests - HTTPBasicAuth  (0) 2019.01.22
library requests - cookie, session, login  (0) 2019.01.21
requests file upload  (0) 2019.01.20
0 Comments
댓글쓰기 폼