Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graphics.asImage() missing buffer when bpp != 8 #1863

Closed
nebbishhacker opened this issue Jun 14, 2020 · 1 comment
Closed

Graphics.asImage() missing buffer when bpp != 8 #1863

nebbishhacker opened this issue Jun 14, 2020 · 1 comment

Comments

@nebbishhacker
Copy link

@nebbishhacker nebbishhacker commented Jun 14, 2020

The buffer field is missing from the output of Graphics.asImage when bpp != 8 and msb = false.

Test case:

let g = Graphics.createArrayBuffer(8,8,1);
let image = g.asImage();
print(image);

Output:

{ "width": 8, "height": 8 }

Expected output:

{ "width": 8, "height": 8, "bpp": 1,
 "buffer": new ArrayBuffer(8)
}

Looks to be the root cause of http://forum.espruino.com/conversations/349170/#comment15347262

@gfwilliams
Copy link
Member

@gfwilliams gfwilliams commented Jun 14, 2020

Argh, sorry - looks like it should have fallen through to copying pixels and it somehow didn't

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants