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

Allow to pick a price proof from your online proof gallery #5326

Closed
teolemon opened this issue Jun 1, 2024 · 19 comments · Fixed by #5679
Closed

Allow to pick a price proof from your online proof gallery #5326

teolemon opened this issue Jun 1, 2024 · 19 comments · Fixed by #5679
Assignees
Labels
✨ enhancement New feature or request Prices ⭐ top issue Top issue.

Comments

@teolemon
Copy link
Member

teolemon commented Jun 1, 2024

Problem

  • to avoid overload of proofs on the Open prices server, we should allow to pick a price proof from your online proof gallery, very much like we already do for regular umages

Code pointers

Part of

@monsieurtanuki
Copy link
Contributor

@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:

  • that would be helpful for proof search or proof gallery order
  • possible discrepancies, with prices sharing the same proof but with different dates and/or locations

@teolemon
Copy link
Member Author

teolemon commented Jun 2, 2024

  • Because currently I am re-adding a slightly different photo of the same receipt for each price using the app 😅
  • This will be largely mitigated by full receipt addition, but depending on user journeys (interrupted or partial input of the products on a receipt, people starting receipt addition from the product page with a single price), we might still want server selection.
  • you are right that there are potential data quality challenges with the uncoupling

@monsieurtanuki
Copy link
Contributor

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...

@monsieurtanuki
Copy link
Contributor

@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.

@raphodn
Copy link
Member

raphodn commented Jun 15, 2024

We already compress the images (done by the web app), so the images shouldn't be that big in size

@monsieurtanuki
Copy link
Contributor

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
Copy link

raphael0202 commented Jun 24, 2024

@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.

@monsieurtanuki
Copy link
Contributor

@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.

@raphael0202
Copy link

I created an issue on Open Prices for this: openfoodfacts/open-prices#340

@teolemon
Copy link
Member Author

@monsieurtanuki
Copy link
Contributor

@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.

@teolemon
Copy link
Member Author

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
Copy link
Member Author

teolemon commented Sep 28, 2024

@monsieurtanuki
Copy link
Contributor

@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".

@raphodn
Copy link
Member

raphodn commented Oct 3, 2024

openfoodfacts/open-prices#340 was merged & deployed !
Proofs now have a new field: image_thumb_path
size 400

example:

@monsieurtanuki
Copy link
Contributor

Thank you @raphodn, now this issue is blocked on our implementation in dart - openfoodfacts/openfoodfacts-dart#978

@monsieurtanuki
Copy link
Contributor

Thanks again @raphodn, I've just tested, that's much faster for our proof gallery!

@monsieurtanuki
Copy link
Contributor

@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.
Image

@monsieurtanuki
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request Prices ⭐ top issue Top issue.
Development

Successfully merging a pull request may close this issue.

4 participants