Skip to content

Conversation

@fetimo
Copy link

@fetimo fetimo commented Sep 22, 2025

Fixes #47

@fetimo fetimo changed the title Change ArrayBuffer handling WIP: Change ArrayBuffer handling Sep 24, 2025
…` and Node `FileNode`, with added tests and `runtime` export.
@fetimo fetimo changed the title WIP: Change ArrayBuffer handling Change ArrayBuffer handling Sep 24, 2025
@fetimo
Copy link
Author

fetimo commented Sep 24, 2025

I've added a few tests for the importImageFileToBase64 helper. I also found that it was needed to check the runtime so I added a helper for that.

I did try to use const binary = new TextDecoder('latin1').decode(imageUint8); for the browser branch but in testing I got an error when trying to convert it to base64. The looping version doesn't have this issue and also allows for much larger file sizes.

The image test bytes are based on https://github.com/mathiasbynens/small/blob/master/jpeg.jpg and https://evanhahn.com/worlds-smallest-png/

Feedback is very welcome :)

@Balearica
Copy link
Contributor

Thanks for contributing, I will try and review this week.

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

Successfully merging this pull request may close these issues.

Maximum call stack size exceeded triggered by importImageFileToBase64

2 participants