-
-
Notifications
You must be signed in to change notification settings - Fork 287
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
Packaging and ingredient photo upload does not work on existing products #3490
Comments
I am having this problem as well. |
@teolemon @FoodCoach-App Please provide barcode examples (and related packaging or ingredient photos). |
I'm setting up the API and am having problems uploading an image data to UPC 0247637306390 The URL request is: https://us.openfoodfacts.org/cgi/product_jqm2.pl?code=0247637306390&user_id=MY_USER_ID&password=MY_PASSWORD&&product_image_upload.pl/imgupload_front=image_front.jpg This is a POST request from Xano if that matters. I'm attempting to follow this example: But they differ on several points. |
This is NOT with the OpenFoodFacts app. I'm attempting to use existing API calls to allow FoodCoach users to add and take pictures of foods for OFF from FoodCoach. |
@monsieurtanuki happens on all products without an ingredients photo |
@teolemon Thank you but I cannot scan, remember? |
@teolemon To be honest this is not a picture from the French Riviera but that's not the point. I went to
Why I may not have worked for you:
|
|
I tried only from basic info. Please provide other barcodes if you want me to try with the carrousel (product page top, right?) and the edit photo / crop page
OK
OK
No this is still not possible for me (cf. #2849) |
Getting the same result when i try. |
@FoodCoach-App @teolemon Done from the product page top carrousel: |
Could be a "waterfall pictures only" filter on the server... ;) |
Or maybe the version? I'm on Android |
@aquilax I don't know anything about the version numbers. I work on the latest github code. |
haha, perhaps.
In your successfully OFF image upload, what is/was the request URL?
I'm attempting to use:
https://us.openfoodfacts.org/cgi/product_jqm2.pl?code=0247637306390&user_id=MY_USERNAME&MY_PASSWORD&product_image_upload.pl/imgupload_front=imagename.jpg
but it's not working.
The response status is: no code or invalid code
What code OFF looking for?
…On Tue, Jan 3, 2023 at 12:13 PM monsieurtanuki ***@***.***> wrote:
Could be a "waterfall pictures only" filter on the server... ;)
—
Reply to this email directly, view it on GitHub
<#3490 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A4J6ZUF53WZ7RJSRWAT6BC3WQRMZ3ANCNFSM6AAAAAATMGSCKQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
The "no code or invalid code" is when I was attempting to upload images with "put". I get "fields saved", but no update to the image when using "get". |
@FoodCoach-App Please have a look at: /// Uploads the product image.
@override
Future<void> upload() async {
final SendImage image = SendImage(
lang: getLanguage(),
barcode: barcode,
imageField: ImageField.fromOffTag(imageField)!,
imageUri: Uri.parse(imagePath),
);
// TODO(AshAman999): check returned Status
await OpenFoodAPIClient.addProductImage(getUser(), image);
} /// Send one image to the server.
/// The image will be added to the product specified in the SendImage
/// Returns a Status object as result.
static Future<Status> addProductImage(
User user,
SendImage image, {
QueryType? queryType,
}) async {
var dataMap = <String, String>{};
var fileMap = <String, Uri>{};
dataMap.addAll(image.toData());
fileMap.putIfAbsent(image.getImageDataKey(), () => image.imageUri);
var imageUri = UriHelper.getUri(
path: '/cgi/product_image_upload.pl',
queryType: queryType,
addUserAgentParameters: false,
);
return await HttpHelper().doMultipartRequest(
imageUri,
dataMap,
files: fileMap,
user: user,
queryType: queryType,
);
} And perhaps https://github.com/openfoodfacts/openfoodfacts-dart/blob/master/lib/src/model/send_image.dart |
4.1.0 876 is latest internal, in sync with the repository |
Mmmmh, note that it also happens on the nutrition fact photo |
@aquilax @FoodCoach-App Can you try uploading with the latest version of the app, and copy paste what ADB mentions |
@monsieurtanuki has set up extra logging |
@teolemon can you help me found out how to get a dev build? |
Ok, I can't upload on product addition either @aquilax it's build from source, of the internal in the README, but I'm not sure it logs everything |
Hello @teolemon I did just try to add a pic and it worked, I clicked to upload from the carousel, |
I'm on Android 13, on a Pixel, for what it's worth. |
@teolemon So you tried on your Android 13 Pixel, you went to a Crop page, you clicked on Confirm and nothing happened:
Am I right? What if you slightly crop the image? |
Bingo, it works on recrop |
Yoohoo! I'll fix it today. For the anecdote
|
What
Steps to reproduce the behavior
The text was updated successfully, but these errors were encountered: