-
-
Notifications
You must be signed in to change notification settings - Fork 286
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
Price proof: convert images to webp before upload ? #5952
Comments
Could be done on the server side when receiving the image file, right?
flutter is not very good converting images: something like slow actions that freeze the app.
That would mean discarding the offline mode. Or maintaining both online and offline mode. What's supposed to happen with slow connectivity? |
The idea is to have both. But if done on the mobile, users would send a ~1MB image, instead of a 10MB image. Good for slow connectivity, no ?
I'm no expert, but we do background tasks already in the mobile app, we want to put some AI, so an image conversion shouldn't be that hard ? |
Actually we don't really care about speed as we do that in background.
It's not hard, it takes resources, for instance we have to save and keep the image in BMP (instead of directly in JPEG) most of the time for performance reasons, and eventually convert it in JPEG but in background (cf. image_compute_container.dart) And there are two different modes. Let's say the user selects a photo from the gallery. We support only JPEG here. Then:
|
Story
In the Open Prices project we've been discussing the idea to convert as much of our images to webp. Why ? No quality impact, but a big size impact (factor of 5-7), all the seconds reduced to upload an image to the server.
This conversion is already done in the web app - prices.openfoodfacts.org.
What about doing it in the mobile app ?
Especially if we want to seperate the "proof upload" and "price upload" actions, and have the proof uploaded as soon as possible so that the server can return the "predictions" (proof type, price/product/location extraction...)
Linked to openfoodfacts/open-prices#577
The text was updated successfully, but these errors were encountered: