You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ensure we can request photo updates for select products to users for images which should be taken or re-taken (because they are too old, or possibly too small / blurry).
It returns a hash of image types + language code (only for the requested language code which should be the language of the app). The value is 0 for images we don't have, or the age of the image (in seconds) for apps that want to add some context like "Our photo of the ingredients is 14 months old, could you take a new one?".
Ensure we can request photo updates for select products to users for images which should be taken or re-taken (because they are too old, or possibly too small / blurry).
https://fr.openfoodfacts.org/api/v0/produit/3483130043180/beurre-cru-a-la-baratte-les-petites-laiteries?fields=images_to_update_fr
It returns a hash of image types + language code (only for the requested language code which should be the language of the app). The value is 0 for images we don't have, or the age of the image (in seconds) for apps that want to add some context like
"Our photo of the ingredients is 14 months old, could you take a new one?"
.Sample API response
Pseudo code to generate button text
for field in images_to_update_fr:
if field.value=0
verb = "take"
else:
verb = "refresh"
field_name = field.split.before("")
field_language = field.split.after("")
button_text = fetch_button_text(field_name, field_language, verb)
Strings to combine (suffix the language at the end)
"Take %s picture"
"Refresh %s picture"
"ingredients"
"front"
"nutrition"
"packaging"
Optional - mention how old the image is
How to convert seconds in human readable format: 83734290 = 2 years and 7 months (example routine to convert) - https://stackoverflow.com/questions/29681328/convert-seconds-into-years-months-weeks-hours-minutes-and-seconds
Send the right query based on the initial field in images_to_update_fr
Extra info
app/src/main/java/openfoodfacts/github/scrachx/openfood/images/ProductImage.java
The text was updated successfully, but these errors were encountered: