Closed lord-zeus closed 5 years ago
Problem is the same as your other issue. Make sure you are using the plugin as explained in readme and as demonstrated in the demo app in this repo.
`const photoEditor = new PhotoEditor();
let imageSource = fromFileOrResource('~/assets/images/logo.png');
console.log("ORIG IMAGE: ", imageSource.height, imageSource.width)
photoEditor.editPhoto({
imageSource: imageSource.android, // originalImage.imageSource,
}).then((newImage) => {
console.log("NEW IMAGE: ", newImage.height, newImage.width)
}).catch((e) => {
` console.error(e);
});`
this is my code
and the console is :
'ORIG IMAGE: ' 252 269
TypeError: options.imageSource.saveToFile is not a function
Hey @lord-zeus , Per the docs and demos you should send the image source to the plugin not the native object like you do. So the correct code should be something like:
const photoEditor = new PhotoEditor();
let imageSource = fromFileOrResource('~/assets/images/logo.png');
console.log("ORIG IMAGE: ", imageSource.height, imageSource.width)
photoEditor.editPhoto({
imageSource,
}).then((newImage) => {
console.log("NEW IMAGE: ", newImage.height, newImage.width)
}).catch((e) => {
console.error(e);
});
fromFileOrResource function is not defined. what we need to import
@max-pro , it is from the image-source
nativescript module: https://docs.nativescript.org/api-reference/modules/_image_source_
No further response so closing this one for now. In case you still have problems, please provide more details.
How to save image. Save function is undefined
passing the image and its not finding the saveToFile function
TypeError: options.imageSource.saveToFile is not a function