From 3ee58b2a231a0571ed1c368a7fb881c1f0ebb5b2 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 16 Jan 2013 15:35:56 +0100 Subject: [PATCH] [IMP] don't reimplement randint manually bzr revid: xmo@openerp.com-20130116143556-qlagrw7qhpuk8fuy --- openerp/tools/image.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openerp/tools/image.py b/openerp/tools/image.py index 508e103..d6a9e3b 100644 --- a/openerp/tools/image.py +++ b/openerp/tools/image.py @@ -26,7 +26,7 @@ except ImportError: from PIL import Image from PIL import ImageOps -from random import random +from random import randint # ---------------------------------------- # Image resizing @@ -124,7 +124,7 @@ def image_colorize(original, randomize=True, color=(255, 255, 255)): image = Image.new('RGB', original.size) # generate the background color, past it as background if randomize: - color = (int(random() * 192 + 32), int(random() * 192 + 32), int(random() * 192 + 32)) + color = (randint(32, 224), randint(32, 224), randint(32, 224)) image.paste(color) image.paste(original, mask=original) # return the new image -- 1.7.10.4