Skip to content
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

After taking a photo and cropping, image shown is the previous one #1194

Closed
Tracked by #513 ...
alexgarel opened this issue Mar 11, 2022 · 7 comments
Closed
Tracked by #513 ...

After taking a photo and cropping, image shown is the previous one #1194

alexgarel opened this issue Mar 11, 2022 · 7 comments
Assignees
Labels
🐛 bug Something isn't working good first issue Good for newcomers image upload 🎯 P1
Milestone

Comments

@alexgarel
Copy link
Member

alexgarel commented Mar 11, 2022

What

If I use the app to take a photo, and then use it again to take another photo, after taking the photo and validating, the image is not the new one taken but the old one.
Though the right photo as been sent to the app.

Steps to reproduce the behavior

See second-photo-bug.pdf

Expected behavior

The photo shown for confirmation and the thumbnail should have been the ingredients photo.

Why

It's important because this is really misleading to users ! And photos are our raw fuel for the database :-)

Smartphone model

  • Device: Huawei Y7 / Samsung S9 (same bug)
  • OS: Android 8.0.0
  • App Version 0.0.2+211 (dev mode)

Tracked in

@monsieurtanuki
Copy link
Contributor

Hi @alexgarel!

Unfortunately I cannot test that, and I guess it's not easy to test either if each time you need to find a new product. We probably need to find a smart way to test it again and again.

What I can say is that on image_crop_page.dart (cf. your step 4) we always use the same final String filePath = '$tempPath/upload_img_file.tmp';, which is probably not a good idea. My hunch is that the file image display has a hidden cache facility and therefore may not refresh the display even when the file is different (and successfully uploaded).

Other suspicious code - after ConfirmAndUploadPicture we get the final photo but it's not the one we use to populate the list:

if (finalPhoto != null) { // finalPhoto is the one the user has eventually chosen
  _uploadedImages[imageType] = _uploadedImages[imageType] ?? <File>[];
  _uploadedImages[imageType]!.add(initialPhoto); // ... but we put the initialPhoto instead
  setState(() {});
}

@teolemon
Copy link
Member

@monsieurtanuki : books :-)

@M123-dev
Copy link
Member

Looks like both should be relatively easy to solve

@teolemon teolemon added 🐛 bug Something isn't working 🎯 P1 image upload labels Mar 11, 2022
@teolemon
Copy link
Member

Thanks for the detailed filing @alexgarel

@cli1005
Copy link
Contributor

cli1005 commented Apr 14, 2022

Issue can not be reproduced:

IMG_8078 IMG_8079

@teolemon
Copy link
Member

cc @alexgarel

@M123-dev
Copy link
Member

Fixed by the cropping library switch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working good first issue Good for newcomers image upload 🎯 P1
Development

No branches or pull requests

5 participants