-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
I tried to use the module with two images, 1st I took an image with the camera module and 2nd I loaded an image from the filesystem. Both times I can display the image in my view, and see in my console.log : Image(14) so I assume the image is loaded properly.
Bot times I get the following error:
Error -> undefined is not an object (evaluating 'image.ios.image')
1st with camera:
camera.takePicture(cameraOptions)
.then( (imageAsset) => {
// Using the image from camera
console.log("imageAsset", imageAsset);
this.image = new Image();
this.image.src = imageAsset;
console.log("imageAsset", imageAsset.nativeImage)
console.log("IMAGE from CAMERA", this.image)
const colors = ImageColors.getColorPalette(this.image)
console.log("FAILS:", colors) // undefined is not an object (evaluating 'image.ios.image')
2nd from file:
const folder: Folder = <Folder> knownFolders.currentApp();
const folderPath: string = path.join(folder.path, "assets/images/test.png");
const imageFromLocalFile: ImageSource = <ImageSource> fromFile(folderPath);
this.image = new Image();
this.image.src = imageFromLocalFile;
console.log("IMAGE from FILE", this.image)
const colors = ImageColors.getColorPalette(this.image)
console.log("FAILS:", colors)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels