after having some issues with getBase64FromImage i decided to send to my mail the result and i got an string with some blank spaces on it (if i’m not wrong that should not be allowed in a base64 string). I guess that’s a bug.
testing on a Nexus 7. Fuse 0.26
cameraRoll.getImage()
.then(function(image) {
ImageTools.getBase64FromImage(image).then(function(ImageBase){
email.compose("myEmail", "", "", "subject", ImageBase);
})
}, function(error) {
// Will be called if the user aborted the selection or if an error occurred.
});
Hey! For fun, if you still have that email, did it actually look like a base64 string with some erroneous spaces in it or did it just look like some garbage? The B64 encoding on Android is handled through the android.util.Base64 class so this is likely me having configured it wrong somehow. Curious to see the string you got though.
E-mail messages doesn’t support very long lines without additional encoding, so it’s likely that the spaces are required to avoid breaking the email-transport.
if i show something like: imgStr.substring(0,50) i see the blank spaces if i URIEncode the result and send it to the email there are blank spaces encoded
Hmmm thanks for that extra info. So looking at our code now what seems to be going wrong is that the image representation returned on iOS is actually a jpg and on android it’s a png. This is clearly wrong, as it should be either the same on both or allow you to choose, so that’s going into an issue.
This would explain why the Base64 comes out different. I’ll write up some tests so the returned data is identical.