I assumed the issue is within jsvGetDataPointer, so attempted flat string instead of native string (if thats what reading from flash is).. So I did :
let rc2 = E.toString(require("Storage").read("rc3.jpg"));
console.log(typeof(rc2));
g.drawImage(rc2);
Issue with this is that its requiring RAM to function and I did like the concept of using direct from flash.
Still in need of full solution, possible bug.
edit:
When using E.toString (flat string) passed to drawImage, the result is an error when the color format is not of custom palette(3bit optimal). : Uncaught Error: Expecting first argument to be an object or a String
at line 4 col 19
So 16bit color format works fine with NativeString, but doesn't like FlatString (unless the reason it failed here was because it didnt fit into memory,possible). And Optimal 3bit doesn't like NativeString but works fine with FlatString.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I sort of solved the issue with the color format myself, the code in Espruino
I assumed the issue is within jsvGetDataPointer, so attempted flat string instead of native string (if thats what reading from flash is).. So I did :
Issue with this is that its requiring RAM to function and I did like the concept of using direct from flash.
Still in need of full solution, possible bug.
edit:
When using E.toString (flat string) passed to drawImage, the result is an error when the color format is not of custom palette(3bit optimal). :
Uncaught Error: Expecting first argument to be an object or a String at line 4 col 19
So 16bit color format works fine with NativeString, but doesn't like FlatString (unless the reason it failed here was because it didnt fit into memory,possible). And Optimal 3bit doesn't like NativeString but works fine with FlatString.