Webviewer Display of JPG files

I’m having a problem with displaying *.jpg files in the webviewer, at least with Android.
For the live version on the smartphone companion, when jpg files are stored as assets, i can get a file to display if it is “hardwired” in as a default property for the webviewer, but cannot get get it to display if called from the blocks:

https://x.thunkable.com/copy/795e00a1e425878f12c732f21b5cda24

It work fines with the Preview and as a mobile web app, but not on the smartphone. I’m testing on a Pixel 7 and Galaxy S21. Do i need to show the path to the asset differently?

Tkx

You’re probably using an image url that isn’t publicly accessible as a direct link to the image.

Can you post one of the urls that is having this issue?

Edit: yep! You’re trying to use a locally-stored image with a Web Viewer:

I don’t think you can do that. Also, why would you want to do that? You can just use an Image component to show local images.

Thanks for the quick reply @tatiang. First, I wonder why the local jpg calls up just fine when entered as the default for the webviewer (in this case, hardwireWebView) but not when selected? In any case, the reason that i wanted to use the webview is that it allows for pinch/zoom whereas the img component does not.

I don’t know why it worked for one but not the other. It should not work for either. I guess you got lucky but again, you really need to use cloud-based urls if you want the web viewer to work consistently.

Thanks again, I appreciate the input and will use IMG. For my particular application, it needs to work offline so grabbing from the cloud isn’t an option but i can make due with the image component. :smile:

1 Like

Well, I came up with three options, none of which are perfect but one of them might work for you:

  1. Convert each image to a PDF and display it in the PDF Viewer in Thunkable. I think this is your best option and it allows for pinch zoom.

  2. I managed to enable pinch zoom on my iPhone in Thunkable Live using this javascript but only for cloud-hosted urls: Pinch and Zoom with native JavaScript. I couldn’t figure out the local path to the file.

  3. I tried to do this with sprites which is a constraint and it doesn’t allow pinch gestures: User resize the image - #2 by tatiang

1 Like