Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fs_product_multi_image from existing db #330

Open
bealdav opened this issue Jan 25, 2024 · 3 comments
Open

fs_product_multi_image from existing db #330

bealdav opened this issue Jan 25, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@bealdav
Copy link
Member

bealdav commented Jan 25, 2024

Is your feature request related to a problem?
Odoo generate product images (image_128, ..._256, 512, 1024, 1920) for its own usages in its modules and fs_storage modules may use images related to the same products for its own purposes.
How to conciliate these behaviors ?

Describe the solution you'd like
After a record is created in fs.product.image (adding an image in tab Images in product) resulting with specific_image res_field in ir.attachment we could also trigger the standard odoo way to generate images (_128 to _1920) to serve both usages ?

If this solution is right I could try to make a PR.

I just would like feedbacks.

Describe alternatives you've considered
I don't know any alternative to keep the 2 behaviors : the odoo way, and the storage way

Additional context
My request is not about migrate product image data from the odoo way to the storage way

cc @lmignon @benwillig @tuantrantg @sbidoul @sebastienbeau

@bealdav bealdav added the enhancement New feature or request label Jan 25, 2024
@lmignon
Copy link
Sponsor Contributor

lmignon commented Jan 26, 2024

@bealdav With fs_product_multi_image, when you upload an image, the original image is preserved as main_image and an image_medium is also generated to use as thumbnail (128x128) into odoo UI see https://github.com/OCA/storage/blob/16.0/fs_image/models/fs_image_mixin.py.

It's on purpose that I decided to only generate one thumbnail from the original image with a size of 128x128 since it's the common size used into the UI to display the image on forms and kanbans. After some research into the code, it seems that the others sizes are only used by the website addons and are therefore useless by default.

When this addon is used next to the shopinvader_search_egine_image addon you have to know that the images make available to the search engine are not the original ones. They are copies of the main image resized to the sizes configured on the search engine backend and named with an localized and SEO compliant name based on the name of the related product.

@bealdav
Copy link
Member Author

bealdav commented Jan 26, 2024

Thanks a lot for this answer and all this huge work on this repo

@lmignon
Copy link
Sponsor Contributor

lmignon commented Jan 26, 2024

@bealdav TIL while diving into the odoo's code.... Images with extensions png,jpeg,bmp,tiff are resized in any case by default to 1920x1920 (see https://github.com/odoo/odoo/blob/17.0/odoo/addons/base/models/ir_attachment.py#L324 for details)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants