projects
/
odoo
/
odoo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c65ae9f
)
[FIX] resize_image: auto convert BMP images to PNG
author
Christophe Simonis
<chs@openerp.com>
Tue, 1 Apr 2014 15:44:17 +0000
(17:44 +0200)
committer
Christophe Simonis
<chs@openerp.com>
Tue, 1 Apr 2014 15:44:17 +0000
(17:44 +0200)
bzr revid: chs@openerp.com-
20140401154417
-c8buuqybdsihn3om
openerp/tools/image.py
patch
|
blob
|
history
diff --git
a/openerp/tools/image.py
b/openerp/tools/image.py
index
08c2fd9
..
93458fb
100644
(file)
--- a/
openerp/tools/image.py
+++ b/
openerp/tools/image.py
@@
-70,7
+70,11
@@
def image_resize_image(base64_source, size=(1024, 1024), encoding='base64', file
image_stream = StringIO.StringIO(base64_source.decode(encoding))
image = Image.open(image_stream)
# store filetype here, as Image.new below will lose image.format
- filetype = filetype or image.format
+ filetype = (filetype or image.format).upper()
+
+ filetype = {
+ 'BMP': 'PNG',
+ }.get(filetype, filetype)
asked_width, asked_height = size
if asked_width is None: