add pillow dependencies (#258)

Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
Hayden
2021-04-03 13:23:26 -08:00
committed by GitHub
parent 764f85fb40
commit ec7fa6332d
5 changed files with 56 additions and 5 deletions

View File

@@ -1,3 +1,4 @@
import shutil
from pathlib import Path
from mealie.core.config import app_dirs
@@ -23,8 +24,9 @@ def minify_image(image_file: Path, min_dest: Path, tiny_dest: Path):
tiny_image = crop_center(img)
tiny_image.save(tiny_dest, quality=70)
except UnidentifiedImageError:
pass
except:
shutil.copy(image_file, min_dest)
shutil.copy(image_file, tiny_dest)
def crop_center(pil_img, crop_width=300, crop_height=300):