Select and Crop Image
Cropping is only relevant for editing existing products. You cannot crop an image the first time you upload it to the system.
Barcode of the product.
identifier of the image to select, it should be a number
identifier of the selected image field, should be in the format
{IMAGE_TYPE}_{LANG}
format, where IMAGE_TYPE
is one of
front|ingredients|nutrition|packaging|other
and LANG
is the 2 letter
language code.
Note that if you select an image for the main language of the product (ex:
ingredients_it
if it
is the main language), this image will be
displayed on Product Opener for all languages (ex: on
https://fr.openfoodfacts.org
, unless ingredients_fr
exists).
X origin coordinate of the crop, it must be lower than x2
Y origin coordinate of the crop, it must be lower than y2
X end coordinate of the crop, it must be higher than x1
Y end coordinate of the crop, it must be higher than y1
angle of the rotation to apply on the selected image.
passing 90
as value rotate the image 90 degrees counter-clockwise.
whether the selected image should be normalized using ImageMagick
"true" | "false"
whether the source image should be white magiced (background removal) using ImageMagick.
"false"
"true" | "false"
A comment on the contribution. Adding meaningful comments help moderators and users understand a single product history.
Name of the app providing the information
Version of the app providing the information
When an app uses a single user to log its contributions, it might be interesting to know which user of the app is providing the information. You can use this field to provide an identifier (eg: an sha1 of the username) that's privacy preserving. Make sure that your salt is strong, perfectly random and secret
In case we have trouble with one of your user, it helps our moderators revert edits.
It is required that you pass a specific User-Agent header when you do an API request. But some times it's not possible to modify such a header (eg. request using JavaScript in a browser). In such cases, you can override it with this parameter.
Response Body
curl -X POST "https://world.openfoodfacts.net/cgi/product_image_crop.pl" \
-F code="04963406" \
-F imgid="2" \
-F id="front_en"
{}