diff --git a/data_nature_importer/README.rst b/data_nature_importer/README.rst index 0f0abe0..d705670 100644 --- a/data_nature_importer/README.rst +++ b/data_nature_importer/README.rst @@ -44,6 +44,7 @@ Changelog - 16.0.1.1.1: Use default image as product image - 16.0.1.2.0: Add Extra Product Media support - 16.0.1.2.1: Add image mime type check +- 16.0.1.2.3: Increase the max image pixels limit for PIL to avoid DecompressionBombError Bug Tracker =========== diff --git a/data_nature_importer/__manifest__.py b/data_nature_importer/__manifest__.py index 0334324..dc4363b 100644 --- a/data_nature_importer/__manifest__.py +++ b/data_nature_importer/__manifest__.py @@ -4,7 +4,7 @@ "author": "BAKEUP", "website": "https://www.bakeup.org", "category": "product", - "version": "16.0.1.2.1", + "version": "16.0.1.2.3", "depends": ["product", "queue_job", "website_sale"], "data": [ "security/ir.model.access.csv", diff --git a/data_nature_importer/models/product_template.py b/data_nature_importer/models/product_template.py index 32d1f2a..015420e 100644 --- a/data_nature_importer/models/product_template.py +++ b/data_nature_importer/models/product_template.py @@ -1,8 +1,14 @@ +from PIL import Image + from odoo import models from .. import utils as dn_utils +# Increase the max image pixels limit for PIL to avoid DecompressionBombError +Image.MAX_IMAGE_PIXELS = 2 * 189135000 # set custom limit for large images + + class ProductTemplate(models.Model): _inherit = "product.template" diff --git a/data_nature_importer/readme/HISTORY.rst b/data_nature_importer/readme/HISTORY.rst index a39c637..d8e83d4 100644 --- a/data_nature_importer/readme/HISTORY.rst +++ b/data_nature_importer/readme/HISTORY.rst @@ -3,4 +3,5 @@ - 16.0.1.1.0: Add Queue Job support and move to server action - 16.0.1.1.1: Use default image as product image - 16.0.1.2.0: Add Extra Product Media support -- 16.0.1.2.1: Add image mime type check \ No newline at end of file +- 16.0.1.2.1: Add image mime type check +- 16.0.1.2.3: Increase the max image pixels limit for PIL to avoid DecompressionBombError \ No newline at end of file diff --git a/data_nature_importer/static/description/index.html b/data_nature_importer/static/description/index.html index 667ce35..55493bd 100644 --- a/data_nature_importer/static/description/index.html +++ b/data_nature_importer/static/description/index.html @@ -387,6 +387,7 @@ ul.auto-toc {
  • 16.0.1.1.1: Use default image as product image
  • 16.0.1.2.0: Add Extra Product Media support
  • 16.0.1.2.1: Add image mime type check
  • +
  • 16.0.1.2.3: Increase the max image pixels limit for PIL to avoid DecompressionBombError
  • diff --git a/nfu_product_bnn_attributes/README.rst b/nfu_product_bnn_attributes/README.rst index c7a42ce..bd5481a 100644 --- a/nfu_product_bnn_attributes/README.rst +++ b/nfu_product_bnn_attributes/README.rst @@ -42,6 +42,7 @@ Changelog - 16.0.1.3.0: Add GTIN Article field and update metadata retrieval - 16.0.1.3.1: Temporay disable image_1920 field verification - 16.0.1.3.2: Temporay disable image_1920 field verification for product.image +- 16.0.1.3.3: Add max size for bith image_1920 fields Bug Tracker =========== diff --git a/nfu_product_bnn_attributes/__manifest__.py b/nfu_product_bnn_attributes/__manifest__.py index 680c06a..afecdd4 100644 --- a/nfu_product_bnn_attributes/__manifest__.py +++ b/nfu_product_bnn_attributes/__manifest__.py @@ -4,7 +4,7 @@ "author": "BAKEUP", "website": "https://www.bakeup.org", "category": "Product", - "version": "16.0.1.3.2", + "version": "16.0.1.3.3", "depends": ["nfu_product", "data_nature_importer"], "data": ["data/ir_config_parameter.xml", "views/product_bnn_views.xml"], "assets": {}, diff --git a/nfu_product_bnn_attributes/models/product_image.py b/nfu_product_bnn_attributes/models/product_image.py index 11c4c8a..119d291 100644 --- a/nfu_product_bnn_attributes/models/product_image.py +++ b/nfu_product_bnn_attributes/models/product_image.py @@ -5,4 +5,6 @@ class ProductImage(models.Model): _inherit = "product.image" # TODO: Remove as soon as data_nature thumbnails work - image_1920 = fields.Image(verify_resolution=False) + image_1920 = fields.Image( + "Image", max_width=1920, max_height=1920, verify_resolution=False + ) diff --git a/nfu_product_bnn_attributes/models/product_template.py b/nfu_product_bnn_attributes/models/product_template.py index 7525061..f0b7dc0 100644 --- a/nfu_product_bnn_attributes/models/product_template.py +++ b/nfu_product_bnn_attributes/models/product_template.py @@ -7,7 +7,9 @@ class ProductTemplate(models.Model): _inherit = "product.template" # TODO: Remove as soon as data_nature thumbnails work - image_1920 = fields.Image(verify_resolution=False) + image_1920 = fields.Image( + "Image", max_width=1920, max_height=1920, verify_resolution=False + ) manufacturer_abbr = fields.Char(string="Manufacturer Abbreviation") # Should be moved to product.product at some point diff --git a/nfu_product_bnn_attributes/readme/HISTORY.rst b/nfu_product_bnn_attributes/readme/HISTORY.rst index 2e79dc7..aff02ef 100644 --- a/nfu_product_bnn_attributes/readme/HISTORY.rst +++ b/nfu_product_bnn_attributes/readme/HISTORY.rst @@ -7,4 +7,5 @@ - 16.0.1.2.2: Enable Unit of Measure on installation - 16.0.1.3.0: Add GTIN Article field and update metadata retrieval - 16.0.1.3.1: Temporay disable image_1920 field verification -- 16.0.1.3.2: Temporay disable image_1920 field verification for product.image \ No newline at end of file +- 16.0.1.3.2: Temporay disable image_1920 field verification for product.image +- 16.0.1.3.3: Add max size for bith image_1920 fields \ No newline at end of file diff --git a/nfu_product_bnn_attributes/static/description/index.html b/nfu_product_bnn_attributes/static/description/index.html index 4b44c14..222c00a 100644 --- a/nfu_product_bnn_attributes/static/description/index.html +++ b/nfu_product_bnn_attributes/static/description/index.html @@ -396,6 +396,7 @@ ul.auto-toc {
  • 16.0.1.3.0: Add GTIN Article field and update metadata retrieval
  • 16.0.1.3.1: Temporay disable image_1920 field verification
  • 16.0.1.3.2: Temporay disable image_1920 field verification for product.image
  • +
  • 16.0.1.3.3: Add max size for bith image_1920 fields