0xDeCA10B
0xDeCA10B copied to clipboard
[demo] Show image for the original data when looking at refund/reward data for an image classifier
I started to do this but the image wouldn't display. I was doing stuff like:
img = document.getElementById('input-image');
canvas = document.createElement('canvas');
context = canvas.getContext('2d');
canvas.width = img.width;
canvas.height = img.height;
context.drawImage(img, 0, 0 );
img2 = document.createElement("img");
img2.src = canvas.toDataURL();
document.body.appendChild(img2);
I was trying to save canvas.toDataURL()
to the database of original data as text and then load it into an <img>
tag. It wouldn't display.
Could be an issue with how database is modifying/formatting the data text. Possible to try saving images in a different format like binary blob?