mirror of
https://github.com/simon987/Simple-Incremental-Search-Tool.git
synced 2025-04-16 08:46:49 +00:00
15 lines
292 B
Python
15 lines
292 B
Python
from PIL import Image
|
|
|
|
|
|
class ThumbnailGenerator:
|
|
|
|
def __init__(self, size):
|
|
self.size = (size, size)
|
|
|
|
def generate(self, path, dest_path):
|
|
|
|
image = Image.open(path)
|
|
image.thumbnail(self.size, Image.BICUBIC)
|
|
image.save(dest_path)
|
|
image.close()
|