Get image data from automated download
I have this page which displays a render using threejs and renders it into a png and downloads it. i need that image to use it in a canvas from deno-canvas but when i download it using this package it returns this
'C:\Users\titul\AppData\Local\Temp\deno_dwldf3d5cf300f407d23/E:\Arcunis\recipeImageMaker\stone.png'
code where i download it:|
1 Reply
I wasn't able to find the answer to your question in the official Deno documentation. However, based on the code snippet you provided, there might be a potential issue with the way you are constructing the file path for the download destination.
In the
download
function, you are using Deno.cwd() + "\\stone.png"
to specify the file path. This could potentially lead to path issues, especially if Deno.cwd()
returns a path that does not end with a backslash. It's generally safer to use Deno.cwd()
in combination with Deno.build.os
to check the operating system and use the appropriate path separator, or better yet, use the path
module from Deno's standard library to join paths in a cross-platform way.
Here's a revised version of your code using the path
module:
Please note that the advice provided here is not based on the Deno documentation, and you should double-check the accuracy of the advice given. Additionally, ensure that the URL you are downloading from is correct and that the server is configured to serve the image as expected.