[FIX] web: invalid image placeholder resizing

Access `/web/image/82303?height=16`, traceback because the placeholder
image cannot be resized to `"16"`.

closes odoo/odoo#92891

Signed-off-by: Julien Castiaux <juc@odoo.com>
This commit is contained in:
Julien Castiaux
2022-06-03 18:34:49 +02:00
committed by Julien Castiaux
parent c5f0e89bca
commit fc115ebdf7
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -183,7 +183,7 @@ class DiscussController(http.Controller):
raise NotFound()
return request.env['ir.binary']._get_image_stream_from(
attachment_sudo, width=width, height=height
attachment_sudo, width=int(width), height=int(height)
).get_response(as_attachment=kwargs.get('download'))
# --------------------------------------------------------------------------
+1 -1
View File
@@ -142,7 +142,7 @@ class Binary(http.Controller):
width, height = image_guess_size_from_field_name(field)
record = request.env.ref('web.image_placeholder').sudo()
stream = request.env['ir.binary']._get_image_stream_from(
record, 'raw', width=width, height=height, crop=crop,
record, 'raw', width=int(width), height=int(height), crop=crop,
)
send_file_kwargs = {'as_attachment': download}
+1 -1
View File
@@ -820,7 +820,7 @@ class WebsiteSlides(WebsiteProfile):
raise werkzeug.exceptions.NotFound()
return request.env['ir.binary']._get_image_stream_from(
slide, field, width=width, height=int(height), crop=int(crop)
slide, field, width=int(width), height=int(height), crop=int(crop)
).get_response()
# SLIDE.SLIDE UTILS