openfoodfacts / openfoodfacts-server

Open Food Facts database, API server and web interface - 🐪🦋 Perl, CSS and JS coders welcome 😊 For helping in Python, see Robotoff or taxonomy-editor
http://openfoodfacts.github.io/openfoodfacts-server/
GNU Affero General Public License v3.0
643 stars 374 forks source link

Allow for a photo comment to be passed with image upload API requests #6534

Open teolemon opened 2 years ago

teolemon commented 2 years ago

What

Example

https://world.openfoodfacts.org/product/8006786051900/gel-hydroalcoolique-primagel image

Code pointers

The corresponding code in cgi/product_image_upload.pl and Images.pm (process_image_upload() function)

Part of

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 90 days with no activity.

stephanegigandet commented 2 years ago

The corresponding code in cgi/product_image_upload.pl and Images.pm (process_image_upload() function)

deveshidwivedi commented 5 months ago

Hi @stephanegigandet! As a part of this do we need a new subroutine that takes the comment as an input from user?

stephanegigandet commented 5 months ago

Hi @stephanegigandet! As a part of this do we need a new subroutine that takes the comment as an input from user?

Hi @deveshidwivedi , this issue is for API request, to have a comment supplied by the app (not the user). So there is no need to add an input from user, we just need to change the backend to record the comment supplied through the API.

deveshidwivedi commented 5 months ago

Hi @stephanegigandet! Is this the correct way to proceed?

stephanegigandet commented 5 months ago

Hi @deveshidwivedi it's a good start, you need to call request_param("comment") to get the value passed to the API. Also we may want to keep "Image upload" as the comment, and then add the comment passed to the app to it. e.g. "Image upload - some extra comment from the app / the user"

deveshidwivedi commented 5 months ago

Thank you! @stephanegigandet I get it now