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

Convert Proof images to WebP ? #577

Open
raphodn opened this issue Nov 25, 2024 · 5 comments
Open

Convert Proof images to WebP ? #577

raphodn opened this issue Nov 25, 2024 · 5 comments
Labels

Comments

@raphodn
Copy link
Member

raphodn commented Nov 25, 2024

Story

We currently store as-is the proof images that we receive (and we also create a thumbnail, thanks to #340 )

The frontend currently converts on the fly the user images to .webp before sending them to the server. done here
But the mobile integration sends the raw images.

Should we convert images in the backend ? Should we push the mobile to convert locally as well ?

Why WebP ?

Alternatives to WebP ?

AVIF

@raphodn raphodn added the Proofs label Nov 25, 2024
@raphael0202
Copy link
Contributor

For information, we get a ~30% file size decrease when using webp: https://developers.google.com/speed/webp.

@raphodn
Copy link
Member Author

raphodn commented Nov 26, 2024

When using the web app "proof upload" workflow, I get a decrease by a factor of 6-7 👀

JPG 100% WebP 80% JPG 80%
Stats .jpg
4608x3456
7.5 MB
.webp
4608x3456
987 kB
.jpg
4608x3456
1.8 MB
Raw image https://ibb.co/HF4RrQ6 https://ibb.co/n67J75R https://ibb.co/gdPWqHY
Zoomed in screenshot Image Image

@raphael0202
Copy link
Contributor

That's impressive!

@raphodn raphodn changed the title Convert Proof images to webp ? Convert Proof images to WebP ? Nov 26, 2024
@raphodn
Copy link
Member Author

raphodn commented Nov 27, 2024

As discussed, priority is rather to have the mobile app send us a .webp directly (will speed up contribution, and bandwith).
Edit: issue created here: openfoodfacts/smooth-app#5952

We can postpone to later the decision to convert in the backend the non-webp images that we receive.

@raphodn
Copy link
Member Author

raphodn commented Dec 3, 2024

Related: it doesn't seem we retain EXIF data (both from WebP images coming from the web app, and JPEG images coming from the mobile app).

I created an issue related to the frontend to understand why (i thought EXIF was kept): fengyuanchen/compressorjs#196

Edit : moving the discussion here: openfoodfacts/open-prices-frontend#1092

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Backlog
Development

No branches or pull requests

2 participants