Describe the bug
A clear and concise description of what the bug is.
"Image not defined" error when trying to run a simple dataURLtoImage() conversion in node.js
To Reproduce
Steps to reproduce the behavior:
Go to '...'
Click on '....'
Scroll down to '....'
See error
See test.js script in node.js below:
const test = require("image-conversion");
var data = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAALtJREFUOE9jXHXs/38GJBBmxYjMxWCvOoainIER2QBCmmGmIRsCNwBZs4qKCsOdO3cY0Glk58AMob4BR9c34w0D68BasDyGC6RftjCAJGEGEGI/Fa8BGwT3AroBuJwBMxjDAFAggmxHthmfIVgDUSzgKMOrDdZwb2AzAGQBzmiEGYAvFAkmJJAh+ADIhVhdANMECgt0QyaEPWQoWCUP9h7MlRhhgM8AmBxVDIDFFNkuQE6FKAkJ2QukxAIAO2u38XQweIsAAAAASUVORK5CYII=";
async function dataURLtoFile(dataURL){
var image = await test.dataURLtoImage(dataURL);
return image;
}
var finalImage = dataURLtoFile(data);
Expected behavior
A clear and concise description of what you expected to happen.
I didn't expect any errors with this simple script
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
OS: [e.g. iOS]: tested both on iPad OS and MacOS 14.2.1
Browser [e.g. chrome, safari] *used node.js not browser
Version [e.g. 22]: node 18.17. 1 on iPad OS and 20.12.2 on MacOS
Additional context
Add any other context about the problem here.
I'm a novice node.js user and apologize if I'm not understanding something basic about how image-conversion works. I'm hoping to use it both on node.js side and on client side browser (through loading through script).
Additionally, if could suggest once I get image-conversion working on my system, how I might easiest then convert the Image back to an image file and store as a local .jpeg file (e.g. store var finalImage in my script above), I'd appreciate it.
Describe the bug A clear and concise description of what the bug is.
"Image not defined" error when trying to run a simple dataURLtoImage() conversion in node.js
To Reproduce Steps to reproduce the behavior:
See test.js script in node.js below:
Expected behavior A clear and concise description of what you expected to happen.
I didn't expect any errors with this simple script
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context Add any other context about the problem here.
I'm a novice node.js user and apologize if I'm not understanding something basic about how image-conversion works. I'm hoping to use it both on node.js side and on client side browser (through loading through script).
Additionally, if could suggest once I get image-conversion working on my system, how I might easiest then convert the Image back to an image file and store as a local .jpeg file (e.g. store var finalImage in my script above), I'd appreciate it.
Thanks!