diff --git a/zip_product_image/README.rst b/zip_product_image/README.rst index f64a6466..5c3c32e7 100644 --- a/zip_product_image/README.rst +++ b/zip_product_image/README.rst @@ -22,7 +22,9 @@ Zip Product Images |badge1| |badge2| |badge3| -Wizard to generate a zip images of selected products +Wizard to generate a zip images file of selected variant products. + +This module is compatible with fs_product_multi_image module (from OCA/storage) but doesn't depends on it. **Table of contents** diff --git a/zip_product_image/models/product.py b/zip_product_image/models/product.py index 84f5326c..9b7e5650 100644 --- a/zip_product_image/models/product.py +++ b/zip_product_image/models/product.py @@ -2,6 +2,8 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). import base64 +import imghdr + from odoo import api, models LIMIT = 500 @@ -29,4 +31,6 @@ def _product_image_data(self): if self.image: return (base64.b64encode(self.image.getvalue()), self.image.extension) return (False, False) - return (self.image_1920 or False, '.jpg') + image_data = base64.b64decode(self.image_1920) + image_type = imghdr.what(None, h=image_data) + return (self.image_1920 or False, f".{image_type}") diff --git a/zip_product_image/readme/DESCRIPTION.rst b/zip_product_image/readme/DESCRIPTION.rst index 774b5222..e8618348 100644 --- a/zip_product_image/readme/DESCRIPTION.rst +++ b/zip_product_image/readme/DESCRIPTION.rst @@ -1 +1,3 @@ -Wizard to generate a zip images of selected products +Wizard to generate a zip images file of selected variant products. + +This module is compatible with fs_product_multi_image module (from OCA/storage) but doesn't depends on it. diff --git a/zip_product_image/static/description/index.html b/zip_product_image/static/description/index.html index 9f1bfff0..717b008e 100644 --- a/zip_product_image/static/description/index.html +++ b/zip_product_image/static/description/index.html @@ -369,7 +369,8 @@
Wizard to generate a zip images of selected products
+Wizard to generate a zip images file of selected variant products.
+This module is compatible with fs_product_multi_image module (from OCA/storage) but doesn’t depends on it.
Table of contents