You are reading a single comment by @d3nd3-o0 and its replies. Click here to read the full conversation.
  • I sort of solved the issue with the color format myself, the code in Espruino

    char *dataPtr = jsvGetDataPointer(info->buffer, &dataLen);
            if (info->bpp<=8 && dataPtr && imgStart<dataLen) {
              info->paletteMask = (uint32_t)(paletteEntries-1);
              info->palettePtr = &dataPtr[info->bufferOffset];
            }
    

    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.

About

Avatar for d3nd3-o0 @d3nd3-o0 started