Loading external web images...
-
Hello!.
I'm looking a way to separate all media files apart from .wasm to reduce file size ...
My web app uses heavy weight images and i think is good idea to separate them from main file, so i was wondering if there is a way to put those images outside..Maybe something like this could be my root web directory:
myWebApp.wasm
image0.jpg
image1.jpg
etc...then in my code load it:
Image { id: pic width: 300 height: 300 anchors.centerIn: root source: "./image0.jpg" }
but no image is shown..
A Resource File could be larger too, so it would partially solve the problem if i do a single resource file per image ?
-
Hello!.
I'm looking a way to separate all media files apart from .wasm to reduce file size ...
My web app uses heavy weight images and i think is good idea to separate them from main file, so i was wondering if there is a way to put those images outside..Maybe something like this could be my root web directory:
myWebApp.wasm
image0.jpg
image1.jpg
etc...then in my code load it:
Image { id: pic width: 300 height: 300 anchors.centerIn: root source: "./image0.jpg" }
but no image is shown..
A Resource File could be larger too, so it would partially solve the problem if i do a single resource file per image ?
@1XU7 I dont think that you can use relative path to images if they are outside of main project (not inside resource file in project), because webassembly (.wasm project) is sandboxed and can see just what is inside "his" sandboxed filesystem.
So i am not 100% on this but i think that only way to load external images is to specifie full path where there are hosted (for instance: myhost.com/images/image1.jpg)