From 8fbbe04a50370f7da775688ccfc12e4779ef4a00 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Fri, 5 May 2017 15:34:20 +0200 Subject: [PATCH] [FIX] tools: always preload PIL with basic formats Ensures that only the desired list of images formats are made available via PIL: BMP, GIF, PNG, JPEG, TIFF and PPM. --- odoo/tools/image.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/odoo/tools/image.py b/odoo/tools/image.py index 952d6b25c4c..05f077d572b 100644 --- a/odoo/tools/image.py +++ b/odoo/tools/image.py @@ -10,6 +10,10 @@ from PIL import Image from PIL import ImageEnhance from random import randrange +# Preload PIL with the minimal subset of image formats we need +Image.preinit() +Image._initialized = 2 + # ---------------------------------------- # Image resizing # ----------------------------------------