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

Incorrect check for base64 data in image loader #35

Closed
zkolter opened this issue Feb 1, 2024 · 0 comments · Fixed by #37
Closed

Incorrect check for base64 data in image loader #35

zkolter opened this issue Feb 1, 2024 · 0 comments · Fixed by #37
Assignees
Labels
bug Something isn't working

Comments

@zkolter
Copy link

zkolter commented Feb 1, 2024

The processing of input images in base64 format assumes that base64 strings will always end with '=' or '==':

const base64Pattern = /^[A-Za-z0-9+/]+={1,2}$/ // detect by checking for equals signs at the end

This isn't a valid test of base64 data, though. If the content has a multiple of 3 bytes, there won't be any trailing '='. This will cause the library to try to open a file with the filename of the base64 string in these cases.

@BruceMacD BruceMacD self-assigned this Feb 1, 2024
@jmorganca jmorganca added the bug Something isn't working label Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants