You are reading a single comment by @d3nd3-o0 and its replies. Click here to read the full conversation.
  • Hi - I think what you're doing is not uploading a binary image file, but instead you're just uploading the text require("heatshrink").decompress.... into a file. g.drawImage is expecting a binary file.

    To write a file like that, all you'd need to do is:

    require("Storage").write("testimg.img", require("heatshrink").decompress(atob("w­GAiBC/AFfo8gBC4gFEAK"))
    

    However that's unlikely to work for bigger images as there isn't enough RAM. What I'd suggest is you simply use the image converter built into the IDE, which can upload direct to Storage. There's actually an example of doing exactly that at https://www.espruino.com/Bangle.js+Graph­ics

About

Avatar for d3nd3-o0 @d3nd3-o0 started