From b7789771f08eefcbedf2493c68dc15dc5207410e Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 19 Jan 2017 10:03:53 +0100 Subject: [PATCH] [FIX] tools: colorize image with pillow 4.0 Introduced by python-pillow/Pillow@c3fe5d43 and integrated into pillow 4.0 The size of the image is ignored and must be set using an image or a mask. This patch is retrocompatible with the previous versions as the changed code was in the box size computation. With this patch a 4 points box size is given so the modified code is not executed. Fixes #14927 --- openerp/tools/image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/tools/image.py b/openerp/tools/image.py index e53ee879f58..f1293b52fff 100644 --- a/openerp/tools/image.py +++ b/openerp/tools/image.py @@ -183,7 +183,7 @@ def image_colorize(original, randomize=True, color=(255, 255, 255)): # generate the background color, past it as background if randomize: color = (randint(32, 224), randint(32, 224), randint(32, 224)) - image.paste(color) + image.paste(color, box=(0, 0) + original.size) image.paste(original, mask=original) # return the new image buffer = StringIO.StringIO()