mirror of
https://github.com/simon987/Simple-Incremental-Search-Tool.git
synced 2025-12-14 07:39:05 +00:00
Progress bar + thumbnail generator
This commit is contained in:
14
thumbnail.py
Normal file
14
thumbnail.py
Normal file
@@ -0,0 +1,14 @@
|
||||
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()
|
||||
Reference in New Issue
Block a user