Closed teolemon closed 1 month ago
@teolemon cf. @raphael0202 @raphodn
to avoid overload of proofs on the Open prices server
I cannot picture exactly how much it will prevent the overload of proofs. I mean, for the moment in Smoothie we add only prices at the individual product level, but it's temporary. We'll soon be able to add the prices of a whole receipt in one shot (and with only one proof).
I suggest that in "Prices" they recognize identical proof images and return the "old" proof id if relevant - without storing the new one.
we should allow to pick a price proof from your online proof gallery, very much like we already do for regular images
Nice feature, though.
Possible incoherence in the "prices" data model: there are no date or location for proofs:
I still believe it's a minor issue for very specific rare use cases. And you would need the user to be aware enough of the space needed on the server and to check the proof image repository instead of just taking a new picture.
Would probably be better to systematically ask the user for camera / gallery and also latest local proof / server proofs. First step is to split the "proof image" button in "camera" and "gallery". Then "server proof gallery". And probably "latest local proof".
Btw, surprised it got the "top issue" label...
@raphael0202 @raphodn Are there some plans about getting smaller versions of proof images, like max width or height = 400? We don't need big pictures for a gallery.
We already compress the images (done by the web app), so the images shouldn't be that big in size
We already compress the images (done by the web app), so the images shouldn't be that big in size
Thanks for your answer! You mean size in memory, not in width/height, right? (that wouldn't change much in this particular case, though) For the record we don't compress images from Smoothie.
@raphael0202 @raphodn Are there some plans about getting smaller versions of proof images, like max width or height = 400? We don't need big pictures for a gallery.
Not yet, but it's something we can implement. And to answer your latest question, yes we only compress it server-side with webp, we don't resize it.
@raphael0202 In OFF there are 100, 200 and 400 versions (max width and max height). I think we only use 400 and full versions in Smoothie. I guess resizing as 400 (on demand only, no need to store on the Prices server?) would be enough for us.
I created an issue on Open Prices for this: https://github.com/openfoodfacts/open-prices/issues/340
@teolemon Not sure what you mean: in Smoothie we don't upload a proof without prices. That mean that even if you selected a proof and typed in the prices for 48 products, if you encountered the "losing all work already done" Smoothie bug, no proof was uploaded at all.
In some cases, you can add 1 receipt with only 10 out of 48 prices. And this receipt is available for completion server side (the web app already does that)
@teolemon Indeed, as long as you actually created prices (with a proof), the proof is uploaded.
Therefore, still waiting for the 400
version of the proof images in order to display correctly a gallery in Smoothie, and then to let the user select a proof from its previous proofs, as an option added to "from camera" and "from device gallery".
https://github.com/openfoodfacts/open-prices/issues/340 was merged & deployed !
Proofs now have a new field: image_thumb_path
size 400
example: https://prices.openfoodfacts.org/img/0011/nTPdYlTHfw.webp / https://prices.openfoodfacts.org/img/0011/nTPdYlTHfw.400.webp
Thank you @raphodn, now this issue is blocked on our implementation in dart - https://github.com/openfoodfacts/openfoodfacts-dart/issues/978
Thanks again @raphodn, I've just tested, that's much faster for our proof gallery!
@raphodn @raphael0202 @teolemon Testing the "add a price to an existing proof taken from the gallery" feature, I've noticed an unexpected behavior regarding duplicates. I've managed to add twice the same product to the same proof. Not nice. Maybe a bit cleaner if the latest price overrides the other ones, for that barcode and that proof.
The only thing that is currently missing in this issue is adding the "pick a proof from proof gallery" to "take a picture" and "pick a picture from the local gallery". Working on it.
Problem
Code pointers
Part of
5072