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

Module: HTML Editor

Entity: ir.attachment

Compute Method: _compute_image_size

View 20.0
Inputs Method Outputs
  • raw
+ for attachment in self:
+             try:
+                 image = binary_to_image(attachment.raw or b'')
+                 attachment.image_width = image.width
+                 attachment.image_height = image.height
+             except UserError:
+                 attachment.image_width = 0
+                 attachment.image_height = 0
  • image_width
  • image_height

Back to entity