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

[FW][FIX] base: fix autoresize and exclude gif #96848

Closed

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Jul 27, 2022

Odoo may resize attachment image with side larger than 1920 pixels.

But for animated gifs, this resizement seems to in general increase size
file which is not what we want (in some case making it grow from 3MB to
60 MB).

So with this change, we only resize and optimize images that are not
gifs.

Reasoning: pillow doesn't seem to resize GIF (and seems to only increase
their size, especially animated GIF, because each frame is not
optimized) so we should just not touch them.

Note:

  • currently tiff were not resized (because of a mimetype typo)
  • currently image dimensions were not resized (from our test, resizing
    on the dimension does not change the size much, quality is most
    important).

both of these issue have been solved in this commit.

opw-2897291

Note: In the ticket case, a 4MB gif would grow to 60 MB. Here is an example of a 300 KB gif that is getting saved as 3 MB:

bignyan

Forward-Port-Of: #96307

Odoo may resize attachment image with side larger than 1920 pixels.

But for animated gifs, this resizement seems to in general increase size
file which is not what we want (in some case making it grow from 3MB to
60 MB).

So with this change, we only resize and optimize images that are not
gifs.

Reasoning: pillow doesn't seem to resize GIF (and seems to only increase
their size, especially animated GIF, because each frame is not
optimized) so we should just not touch them.

Note:

- currently tiff were not resized (because of a mimetype typo)
- currently image dimensions were not resized (from our test, resizing
  on the dimension does not change the size much, quality is most
  important).

both of these issue have been solved in this commit.

opw-2897291

X-original-commit: 743ab67
@robodoo
Copy link
Contributor

robodoo commented Jul 27, 2022

@fw-bot
Copy link
Contributor Author

fw-bot commented Jul 27, 2022

This PR targets 15.0 and is part of the forward-port chain. Further PRs will be created up to master.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@robodoo robodoo added the forwardport This PR was created by @fw-bot label Jul 27, 2022
@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Jul 27, 2022
@fw-bot
Copy link
Contributor Author

fw-bot commented Jul 27, 2022

Ping @nle-odoo
The next pull request (#96859) is in conflict. You can merge the chain up to here by saying

@fw-bot r+

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@nle-odoo
Copy link
Contributor

fw-bot r+

@robodoo robodoo closed this in 862aca7 Jul 27, 2022
@robodoo robodoo temporarily deployed to merge July 27, 2022 13:26 Inactive
@fw-bot fw-bot deleted the 15.0-14.0-base-opw-2897291-nle-R_2a-fw branch August 10, 2022 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
forwardport This PR was created by @fw-bot OE the report is linked to a support ticket (opw-...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants