This is an example code.
var image = await ImagePicker.pickImage(source: ImageSource.camera);
var stringBytes = base64.encode(image.readAsBytesSync());
var bytes = base64.decode(stringBytes);
var newImage = new File.fromRawPath(bytes);
I/flutter (14608): The following FileSystemException was thrown resolving an image codec:
I/flutter (14608): Cannot open file, path = '????*?Exif
I/flutter (14608):
I/flutter (14608):
I/flutter (14608): Business
I/flutter (14608): 11:42:34
I/flutter (14608): ?
I/flutter (14608):
I/flutter (14608): ??
I/flutter (14608): ??
I/flutter (14608): %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz???????????????????????????????????????????????????????????????????????????
I/flutter (14608): ??
I/flutter (14608): $4?%?&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz??????????????????????????????????????????????????????????????????????????
I/flutter (14608): ??????U-%?????^
I/flutter (14608): }?m???
I/flutter (14608): u???V?N6R???
I/flutter (14608): j_8}W,1?????w^??? ??6???m???E[????????>???X?W??y??????=?[!??2!??'8?Mk^???eS?
and the list of unknown characters continues.
What am I doing wrong?
I want to convert it in base64 because I am going to add it in a database.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…