Hello everyone,
I am working with Odoo 12.
I have been searching the forum and on web, for information about working with image sizes in Odoo.
I have found lots of information about that but all of them does not fit on my actual requirements.
In fact, most of them only refers to pre-defined image sizes like image big (1024x1024px), image medium and image small. All of them with fixed image sizes. I could not find any information on how to actually define a size for the final image.
What I need to do is:
- Allow user to attach an image to the form;
- Resize this image to a specific image size (let's say: 500x500px), thus reduce it's size;
- Have the image saved on the database;
I am using the standard Odoo image type field (binary) declared like this:
fields.Binary("Image", attachment=True, default:lambda, self:self.SOME_DEFINITION_HERE_WHICH_I_DO_NOT_KNOW);
Can anyone help me achieving that?
Thank you all in advance
Best regards
Paulo
Hope this will helps: http://learnopenerp.blogspot.com/2020/07/how-to-resize-image-on-saving-records-in-odoo.html
To resize image in Odoo14: https://learnopenerp.blogspot.com/2021/09/dynamically-image-resizing-save-write-odoo14.html