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

Mobile app: fine-tuning needed for 'image_to_update' #9226

Closed
monsieurtanuki opened this issue Oct 29, 2023 · 4 comments
Closed

Mobile app: fine-tuning needed for 'image_to_update' #9226

monsieurtanuki opened this issue Oct 29, 2023 · 4 comments
Labels
🤳🥫 blocking mobile apps This issues are blocking a feature on the Open Food Facts mobile apps 🖼️ Image refresh 🖼️ Images 🤳🥫 mobile apps ⭐ top issue Top issue.

Comments

@monsieurtanuki
Copy link
Contributor

Problem

In the latest Smoothie POC (openfoodfacts/smooth-app#4674), we want to display an additional icon for pictures that are outdated - let's say more than 1 year old.

There are two problems.

First, we expect seconds in images_to_update_fr. But looking at https://world.openfoodfacts.org/api/v3/product/3017620422003?fields=code,product_name,images_to_update_fr, we get

  • "front_fr":91593030 (1060 days)
  • "ingredients_fr":200038598 (2315 days)

Which does not match what we find in history about last modification for https://fr.openfoodfacts.org/produit/3017620422003/nutella-ferrero:

  • 2023/08/24-06:31:01 CEST for "front_fr"
  • 2023/08/14-13:53:56 CEST for "ingredients_fr"

Is there something wrong? (possibly, my interpretation of how to read the data)

Second, AFAIK we get the image freshness only for the specified languages.
And we would like the image freshness for all languages, a bit like what we have for product name ("product_name_languages").
A typical use case would be: "I query the data in French, but I would like an access to all languages' image freshness data, so that in my image screen I can display the freshness of images not only for French images but Italian images".
Something like 'image_to_update_languages'?

Proposed solution

  1. check the exact meaning of the int values of 'image_to_update_xx'.
  2. implement 'image_to_update_languages' or specify the already existing field.
@stephanegigandet
Copy link
Contributor

@monsieurtanuki Sorry for the late reply. The date you get back is not the date the image was selected, but the date that the image was uploaded. So if somebody crops an image from 5 years ago and assigns it to the front_fr image of the product by selecting it / cropping it, you still get a 5 year age, and we still want to ask the user for a new image.

@stephanegigandet
Copy link
Contributor

For the second point, it could be done, but the use case might be less compelling and could be done by using the "images" field which contains the needed data to compute image age.

@monsieurtanuki
Copy link
Contributor Author

@stephanegigandet Thank you for your explanations.

The way I would summarize it is:

  • images_to_update_fr will return the images (for french) whose "root" uploaded image is "too old", and will return the number of seconds between the root image upload and now
  • we wouldn't even need images_to_update_fr as we're able to compute it for all images, for instance
    • the front_fr image is based on root image 87
    • root image 87 has a uploaded_t of 1606987946 (2020/12/03 10:32:26), which can be considered as "too old"
    • the corresponding value of image_to_update_fr is "now - the uploaded timestamp" (today's test value: 103243635)

The next problem is to make it obvious for the user in Smoothie:

  1. this picture is too old
  2. please change it
  3. but do it with a fresher uploaded photo, or take a new picture

That means we need to manually flag uploaded photos as "too old" (so that the users don't select them).
@stephanegigandet What is the current age after which an uploaded photo is considered as too old? 3 years?

@stephanegigandet
Copy link
Contributor

@monsieurtanuki it's best to move as much logic to the server, so that we have a consistent experience on web and mobile, so the server should compute images_to_update_fr. The decision could be made on age to start with, but later it could be made with other inputs (OCR from the images, nutrition facts that have been changed: ask for a new nutrition image etc.)

@teolemon teolemon changed the title Smoothie: fine-tuning needed for 'image_to_update' Mobile app: fine-tuning needed for 'image_to_update' Apr 23, 2024
@teolemon teolemon moved this to To discuss and validate in 🍊 Open Food Facts Server issues Apr 23, 2024
@teolemon teolemon removed the ✨ Feature Features or enhancements to Open Food Facts server label Oct 18, 2024
@github-project-automation github-project-automation bot moved this from To discuss and validate to Done in 🍊 Open Food Facts Server issues Dec 6, 2024
@github-project-automation github-project-automation bot moved this from 💬 To discuss and validate to 🎊 Done in 🤳🥫 The Open Food Facts mobile app (Android & iOS) Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤳🥫 blocking mobile apps This issues are blocking a feature on the Open Food Facts mobile apps 🖼️ Image refresh 🖼️ Images 🤳🥫 mobile apps ⭐ top issue Top issue.
Development

No branches or pull requests

3 participants