+1 vote

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

in Website by (10.5k points) | 114 views

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
205 questions
180 answers
220,657 users