I did some additional research into this today and thought I’d add to the thread. The problem of not being able to represent data in our STRING data type if it contains a null byte is something we hope to address soon. In the meantime, it’s worth documenting that
PNG format images are impossible to represent without null bytes, because each chunk starts with a fixed 8 byte header that specifies the length of the chunk as a 4-byte sequence. If any chunk is shorter than 16MB, the highest order byte in that chunk’s header will be a null byte.
GIF also requires null bytes. The first nulls in a GIF are the terminators for the width and height of the canvas, so it’s also impossible to create a GIF without nulls.
JPEG uses null bytes to separate image chunks.
So all conventional image formats are going to fall foul of this. The only option that would work is an SVG containing an embedded image, inlined using a data: uri. This would mean that the image data would leave the Fastly server still in base64 encoded form, and would only be decoded on the browser. However, there’s really no sensible reason to do this!