Please download the attached file for easier understanding.
I'm generating a solid-color image using a Javascript canvas, then passing it to AM as base64 to write and decode the image to storage for further use. The problem is that sometimes depending on the color and size of the image, Java throws a "bad base64" error. The weirdest thing is that switching between 16x16 to 32x32 size (and viceversa) magically solves the error for some images. The good news is that this is deterministic, so it should be easy to reproduce.
I already tried using `urlDecode`, but there's no difference, because the URI is already URL-safe, AFAIK. I gave up trying to debug what am I doing wrong. I guess I have to transcode the base64 to a "dialect" that AM can understand, maybe by using `replaceAll`? or should I use the `base64` shell commamd?