Large images can be a difficult issue for website. They increase the size of the web page and make them slower as a result. This leads to bad SEO rankings and visitor abandonment. In this recipe, we will explore how you can create images of different sizes.
Generating image thumbnails
How to do it...
In Odoo, all image utilities are placed in the odoo/tools/image.py file. You need to add an import statement to use these image utilities:
from odoo import tools
The image_resize_images() method of the image utility helps you manage three different image sizes. To do this, you need to add three binary fields to store the different-sized images:
image = fields.Binary(attachment=True) # 1024x1024px
image_medium = fields.Binary(attachment...