Open Gloumy opened 4 years ago
Same issue. I'm using a multi image picker, and only the last image works. Looking in the source code and logs, it seems that the image is saved as 'apple.jpg' in a temp directory. Meaning if you have multiple calls running at the same time, the image will be overwritten. (and explains why we only have our last image)
I'm nog comfortable enough with Swift to submit a fix, but possibly a unique ID as filename for each image would solve this issue.
I also had the same issue with a multi image picker. Thanks to @vincentderidder 's idea, a new PR is up and waiting to be merged in. https://github.com/NGhebreial/flutter_exif_rotation/pull/30
PR is merged and published, can you try it and tell me if this is still happening?
Hello, I'm getting a weird behavior on iOS (Android is fine though). I'm using image_picker to get images either from camera or gallery, and the user is allowed to call that repeatedly. It works fine for the first picture, but when adding another the picture displayed is the first one. I'm then passing each file to an array in a provider state, and when i do my http call to post them to my backend only the last picture is returned for each file.
getImage()
Future getImage(source) async { var picture = await ImagePicker.pickImage(source: source); if (picture != null) { picture = await FlutterExifRotation.rotateAndSaveImage(path: picture.path); Provider.of<NewDiscussionState>(context).addPicture(picture); } Navigator.pop(context); // Just closing the BottomSheet }
Provider addPicture()
void addPicture(File picture) { _pictures.add(picture); notifyListeners(); }
It looks like the image gets stuck on some cache, but i have no mean to debug it as i don't have a mac environment