Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Web Editor

Entity: ir.attachment

Compute Method: _compute_image_size

View 17.0
Inputs Method Outputs
  • datas
- for attachment in self:
-             try:
-                 image = tools.base64_to_image(attachment.datas)
-                 attachment.image_width = image.width
-                 attachment.image_height = image.height
-             except Exception:
-                 attachment.image_width = 0
-                 attachment.image_height = 0
  • image_width
  • image_height

Back to entity