Changes

Jump to navigation Jump to search
1,369 bytes added ,  14:26, 29 October 2016
Line 1,951: Line 1,951:     
=== Manipulating photos for a product ===
 
=== Manipulating photos for a product ===
 +
==== Understanding products and photos ====
 +
* Photos are the primary source of Open Food Facts.
 +
* We need good photos or the product, of its ingredients and nutrition table. (and for each language present on the packaging)
 +
* Please encourage your users to add as many photos as possible, even if the product is already complete (in that case, don't set them as default photos for  front, ingredients, and nutrition)
 
==== Understanding multilingual products ====
 
==== Understanding multilingual products ====
 
Multilingual products can have several photos based on languages present on the packaging. Just suffix the lang code to our examples to get the relevant language(s).
 
Multilingual products can have several photos based on languages present on the packaging. Just suffix the lang code to our examples to get the relevant language(s).
 +
 +
==== Adding photos for a product ====
 +
 +
* Use the POST method on:
 +
<pre>http://world.openfoodfacts.net/cgi/product_image_upload.pl</pre>
 +
<sup>(remember to do tests on world.openfoodfacts.net - login and password: off )</sup>
 +
 +
===== Parameters =====
 +
* code: the barcode
 +
* imagefield: (front | ingredients | nutrition)
 +
* imgupload_front : your image file if imagefield:front
 +
* imgupload_ingredients: your image file if imagefield:ingredients
 +
* imgupload_nutrition: your image file if imagefield:nutrition
 +
 +
=====Important=====
 +
* There must be a HTTP header "Content-Type: multipart/form-data" in the HTTP POST request.
 +
* The imageupload_(front|ingredients|nutrition) name, size and data needs to be encoded in the multipart/form-data format, usually your HTTP request library will do that for you.
 +
* All parameters need to be passed as POST parameters, do not put some in the URL.
 +
* 0048151623426 is a random barcode used only for demonstration purposes.
 +
 +
 
==== Getting a list of all available photos ====
 
==== Getting a list of all available photos ====
 
==== Adding a photo to the list of all available photos ====
 
==== Adding a photo to the list of all available photos ====

Navigation menu