Closed magcode closed 9 months ago
Currently I don't know how to detect a base64 string except of the trailing =.
Maybe according to a length
Regex maybe?
Yeah, length would be much easier. Everything above 32 (?) chars can be safely treated as a base64.
As I wrote on Discord: JPGs will always start with hex FF D8 FF which will lead to the base64 start of /9j/ (including the /'s). So if you use that to detect, you are safer. Also GIFs start with GIF8, so you can use R0lG at the start of base64 to detect these. (you can combine this with the length test, in case somebody wants to make a very strange icon file name :smiley:) /Greets DLange
Checking the jpg header would require to encode the base64 string first. GIFs as base64 are still not possible. For now awtrix checks the stringlenght.
https://github.com/Blueforcer/awtrix-light/releases/tag/0.92
Bug report
Describe the bug
Some base64 encoded icons are not recognized.
Example is attached
base64 of this image is
Additional information
To Reproduce
Send above base64 as icon.
Expected behavior
All base64 encoded icons work.