I want to improve the quality of an image, but I am not able to display the image generated with the changeDpiDataUrl function. The error I get is "Failed to load resource: Data URL decoding failed".
Without using the base64header, I have no problems. But as soon as the base64header is included, my browser is not able to resolve the image.
My function looks like this

Has anyone had the same problem and knows a solution?