My app keeps crashing when using ImageTools to resize my image in the following function before I create a base64 out if it. Been stuck on this for awhile. I get a SIGABRT error in Xcode as well. Any help is appreciated!
function capturePhoto() {
Camera.capturePhoto()
.then(function (photo) {
var options = {
mode: ImageTools.IGNORE_ASPECT,
desiredWidth: 320, //The desired width in pixels
desiredHeight: 240 //The desired height in pixels
};
ImageTools.resize(photo, options)
.then(function(newImage) { console.log("Path of resized image is " + newImage.path); });
photo.save()
.then(function(filePath) {
console.log("Photo saved to: " + filePath);
arrayBuff = FileSystem.readBufferFromFileSync(filePath);
b64data = Base64.encodeBuffer(arrayBuff); // send this to the backend
photo.release();
})
.catch(function(error) {
console.log("Failed to save photo: " + error);
photo.release();
});
})
.catch(function (error) {
console.log("Failed to capture photo: " + error);
});
}