From ca27673a54612eec6197a233c5f7830e112431c1 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Fri, 5 May 2017 16:55:12 +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. --- openerp/tools/image.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openerp/tools/image.py b/openerp/tools/image.py index 7a6742ce04d..a0cd44a8014 100644 --- a/openerp/tools/image.py +++ b/openerp/tools/image.py @@ -28,6 +28,10 @@ from PIL import Image from PIL import ImageEnhance from random import randint +# Preload PIL with the minimal subset of image formats we need +Image.preinit() +Image._initialized = 2 + # ---------------------------------------- # Image resizing # ----------------------------------------