Skip to Content
Menu
This question has been flagged
3 Replies
6133 Views

hi i want to upload 4K image to to prevent odoo to resize my image on binary fields

Avatar
Discard
Best Answer

To change the limit of image size in Odoo, you can modify the max image size setting in the configuration file or modify the database column to accept larger images. Here's how you can do it:

  1. Modify the max image size setting in the configuration file:
  • Locate the Odoo configuration file (odoo.conf) in the Odoo server directory.
  • Add the following line to the file: limit_memory_hard = 2147483648 (2GB)
  • Save the file and restart the Odoo server.
  1. Modify the database column to accept larger images:
  • Log in to Odoo as an administrator.
  • Go to the Settings menu and select Technical > Database Structure > Fields.
  • Find the binary field that you want to modify and click on it to open the field properties.
  • Change the size attribute of the field to a larger value (e.g. 4194304 for 4MB).
  • Save the changes and restart the Odoo server.

Note that increasing the image size limit may have performance and storage implications, so it is important to consider these factors before making any changes. Also, make sure to back up your database before making any modifications.

Avatar
Discard
Best Answer

By default, Odoo automatically resizes uploaded images to a maximum resolution of 1920x1920 (source: https://github.com/odoo/odoo/blob/18.0/odoo/addons/base/models/ir_attachment.py#L334). If you want to change or remove this limit, follow these steps:

  1. Activate Developer Mode in Odoo.
  2. Go to: Settings → Technical → Parameters → System Parameters.
  3. Create or update the following parameter:
    • Key: base.image_autoresize_max_px
    • Value:
      • 0Disables resizing (allows any size)
      • 2560x1440Sets a custom max resolution (e.g., 2560x1440)
  4. Save changes and test by uploading a larger image.
Avatar
Discard
Best Answer

Hi, I think your solution is focused on increasing filesize in MB, but I guess the question here and mine too, is how to increase resolution limit at conversion upon uploading for all images from current limit 1920px x1080 to say 2560x 1440px...no matter the filesize..?

Avatar
Discard