Fermer les images PIL et borner le cache de cartes de localisation
This commit is contained in:
@ -660,8 +660,8 @@ def generate_thumbnail(src_path, thumb_path, max_size=256, mid_path=None,
|
||||
return source.resize((max(1, int(source.size[0] * scale)),
|
||||
max(1, int(source.size[1] * scale))), resample)
|
||||
|
||||
img = PILImage.open(str(src_path))
|
||||
img = img.convert('RGB')
|
||||
with PILImage.open(str(src_path)) as _src_img:
|
||||
img = _src_img.convert('RGB')
|
||||
Path(thumb_path).parent.mkdir(parents=True, exist_ok=True)
|
||||
if mid_path is not None:
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user