How can I view the images made in the Ionic tutorial photo gallery app


I followed the Ionic v4 tutorial and ‘created’ the photo gallery app as found in the Ionic documentation.
I now tried to expand it by using Photoviewer to fullscreen the image individually when clicking on the image.
In the example code this is given:

*ngFor="let photo of; index as position">
<ion-img src="{{ photo.base64 ? photo.base64 : photo.webviewPath }}" (click)="showActionSheet(photo, position)"></ion-img>

This displays the photos in the gallery. I now tried to give showActionSheet another argument that would be used with Photoviewer to find the location. However, if I try

(click)="showActionSheet(photo, position,photo.base64)

I do see that the Photoviewer on my phone is working but it displays a black image. Would anyone know how to correctly link to an image from local storage?

The strange thing is that the images are displaying so the src link is working but the link does not work when I click on them individually.

1 Like