From 58114e49545c4e3e8ebadec46fb4463d13e9ccbf 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 f1293b52fff..251569c7247 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 # ----------------------------------------