async custom image loader
Unanswered
arashi-dev posted this in #help-forum
I am integrating nextjs with tauri and I must build the nextjs part as
I thought maybe I can make a custom loader function which optimizes the images using the tauri's backend (it's rust) and return their urls but unfortunately the custom image loader's function doesn't support async, therefore I cannot call the backend (rust) to optimize the image before I return their url.
is there any workaround to do this? I could also make a localhost server in the rust code and make a GET endpoint for it which optimizes and returns the optimized image's URL at the same time but that would be too much for such a simple use case
output: "export" which disalllows me to use the default image optimization and it's making a huge problem because I have big lists of high quality images which are saved on the user's local disk.I thought maybe I can make a custom loader function which optimizes the images using the tauri's backend (it's rust) and return their urls but unfortunately the custom image loader's function doesn't support async, therefore I cannot call the backend (rust) to optimize the image before I return their url.
is there any workaround to do this? I could also make a localhost server in the rust code and make a GET endpoint for it which optimizes and returns the optimized image's URL at the same time but that would be too much for such a simple use case