-
-
Notifications
You must be signed in to change notification settings - Fork 396
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
Crash when deleted images are selected / cropped #11044
Comments
@alexgarel @raphael0202 @g123k what if that accounted for the drop in images ? we'd need to check when HEIC behaviors were tweaked by Apple/The Mobile App |
The issue with the app is only when we pick from the gallery. |
This is the supported formats we have for ImageMagick on the server, so HEIC should be supported, but maybe there are more than the two subformat listed below ?
FTR, the full list.
|
Have you tried with my image?
|
Yes I got the same thing, geometry is correctly identified:
(the division by zero is because of wrong geometry detection) |
@g123k do you know what the API call should look like ? |
I have tried to use this image on a dev environment, with the web form, and it works. |
I'm on a track to find products that would have a size w or h of 0 I have to run this query on the parquet file: SELECT code, images FROM food WHERE len(list_filter(images, img -> img.sizes.full.h = 0 OR img.sizes.full.w = 0)) > 0 LIMIT 10; I may try also with 400 in place of full. |
I uploaded the food.parquet from hugging face, then I did: CREATE TABLE images AS SELECT code,images FROM read_parquet('food.parquet');
SELECT code, images FROM images WHERE len(list_filter(images, img -> img.sizes.full.h is null OR img.sizes.full.w is null)) > 0 LIMIT 10;
SELECT code, images FROM images WHERE len(list_filter(images, img -> img.sizes."400".h is null OR img.sizes."400".w is null)) > 0 LIMIT 10; both requests returns some data. There are only 21 problematic products (I only look at uploaded images, not selected):
Looking at it closely: .excel
SELECT code, list_filter(images, img -> img.imgid is NULL AND (img.sizes.full.h is null OR img.sizes.full.w is null OR img.sizes."400".h is null OR img.sizes."400".w is null)) FROM images WHERE len(list_filter(images, img -> img.imgid is NULL AND (img.sizes.full.h is null OR img.sizes.full.w is null OR img.sizes."400".h is null OR img.sizes."400".w is null))) > 0; They are all but one false positive… |
I tried HEIC as well and it seems to be working (at first I thought we may be missing delegate for HEIC). All the images from one product that triggered the error: https://openfoodfacts.sentry.io/issues/3901370484/?project=5376745&referrer=slack (4002809025761) can be read by ImageMagick well.... |
@g123k can you try it again, I added a bit more logs |
@stephanegigandet could it be some race condition ? Like we try to crop an image that is not yet in the product, and auto-vivification use undef values instead of clean values ? If we have undef, perl raise the division by zero error. $ 1 / undef
Use of uninitialized value in division (/) at (eval 308) line 5.
Runtime error: Illegal division by zero at (eval 308) line 5. |
So the issue is that we are trying to crop an image that hasn't been correctly written to the product: https://world.openfoodfacts.org/api/v3/product/4061464973442 : there is no image 5 (even though we do have the image file on the disk) but the app is trying to select it: off@off:/srv/off/logs$ grep "image_crop" modperl_error_log | grep "w: ," So we get undef values for $w and $h:
|
Image 5 was deleted in September: https://world.openfoodfacts.org/product/4061464973442/haselnuss-schnitte-choceur (or more exactly, it was removed from the images structure, but we still have the file on disk... ) |
So I guess we should just add a check in process_image_crop that we do have the image in the images structure, with non zero sizes. |
If that may help you, I've reuploaded the image to https://world.openfoodfacts.org/product/0098765432186/test-product |
Does a user have the right to remove his own images ? How is it that a non moderator can remove an image ? |
Uploaded images (Deleted: 5) -- Selected images (Deleted: packaging_de)
|
Hi everyone!
From the mobile app, I try to upload the following picture: drive.google.com/file/d/1iMwOScee68OgXPQGDxhHr_tqJ81NThN6/view?usp=sharing
However, I receive the following error:
Date/time: 2024-11-24T21:31:22.000261
The text was updated successfully, but these errors were encountered: