#Remote source for image

4 messages · Page 1 of 1 (latest)

buoyant dock
#

Hey all, I am attempting to build a Tauri application that if an image is unavalible on disk, it will download the image and display image by using it's remote url until the component is refreshed at which point the saved image is used. I have this working on dev but when I attempt to run the application using a build release, the image with the remote url does not show. I am on Windows and am using Solidjs as my frontend framework. I am unable to show the downloaded image right away because I recieve a connection error which is resolved when the component is re-rendered. I am sure I am able to find a work around that involves creating a couple more components and some default images but this seems to be an odd enough issue that I wanted to ask if anyone else has encountered it/solved it. Please let me know if you have any questions or any ideas on fixing it! Thank you!

patent garden
#

is the remote image on a http (not https) connection? Because these don't work in built windows apps right now, see https://github.com/tauri-apps/tauri/issues/3007

If that's not the issue you could make a debug build tauri build --debug output in target/debug/) to have access to the terminal and devtools console/network tab which may give you more info.

If that doesn't help or if you already did that, i guess a reproduction example would help us help you.

#

Or maybe i misunderstood the question and the download itself works just not the image refreshing? that's a bit tricky to pinpoint, i'd expect the missing devserver to not be involved in that anyway but idk 🤔

buoyant dock
#

Hi @patent garden , thank you for your response! The images are using https and they are able to download properly onto disk. I built a debug version and it looks like the problem is due to csp policy. My current csp security policy is default-src 'self'; img-src 'self' asset: https://asset.localhost. I was able to get the image to load properly on the frontend by setting asset: https://asset.localhost https://images.sample.com Thank you again for your help!