You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thanks for the great work.
I am trying to migrate from escpos and escpos-usb to your driver.
I tried a simple test async function test() { try { const image = await Image.load('./assets/Packback-black.png'); console.log(image); } catch (error) { console.error('Error loading image:', error); } }
And this successfully loads my image.
Then I tried with a callback function, but this doesn't work : function test(callback) { Image.load('./assets/Packback-black.png', (err, image) => { if (err) { // Handle error console.error('Error loading image:', err); return; } // Image loaded successfully, call the callback function callback(image); }); }
I get the following error
`C:\Users\thoma\Documents\Computer Projects\LTNG-state-machine\xstate\node_modules\get-pixels\node-pixels.js:126
cb(new Error("Unsupported file type: " + mimeType))
^
Error: Unsupported file type: (err, image) => {
if (err) {
// Handle error
console.error('Error loading image:', err);
return;
}
// Image loaded successfully, call the callback function
callback(image);
}
at doParse (C:\Users\thoma\Documents\Computer Projects\LTNG-state-machine\xstate\node_modules\get-pixels\node-pixels.js:126:10)
at C:\Users\thoma\Documents\Computer Projects\LTNG-state-machine\xstate\node_modules\get-pixels\node-pixels.js:190:7
at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read/context:68:3)
`
Like the callback function is interpreted as the "type" parameter of the load function.
But I also tried to add a type but then nothing happens since I don't read the image output.
Any idea what might be the issue ? Do I use the new version wrong ?
Thanks for the help !
The text was updated successfully, but these errors were encountered:
First of all, thanks for the great work.
I am trying to migrate from escpos and escpos-usb to your driver.
I tried a simple test
async function test() { try { const image = await Image.load('./assets/Packback-black.png'); console.log(image); } catch (error) { console.error('Error loading image:', error); } }
And this successfully loads my image.
Then I tried with a callback function, but this doesn't work :
function test(callback) { Image.load('./assets/Packback-black.png', (err, image) => { if (err) { // Handle error console.error('Error loading image:', err); return; } // Image loaded successfully, call the callback function callback(image); }); }
I get the following error
`C:\Users\thoma\Documents\Computer Projects\LTNG-state-machine\xstate\node_modules\get-pixels\node-pixels.js:126
cb(new Error("Unsupported file type: " + mimeType))
^
Error: Unsupported file type: (err, image) => {
if (err) {
// Handle error
console.error('Error loading image:', err);
return;
}
// Image loaded successfully, call the callback function
callback(image);
}
at doParse (C:\Users\thoma\Documents\Computer Projects\LTNG-state-machine\xstate\node_modules\get-pixels\node-pixels.js:126:10)
at C:\Users\thoma\Documents\Computer Projects\LTNG-state-machine\xstate\node_modules\get-pixels\node-pixels.js:190:7
at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read/context:68:3)
`
Like the callback function is interpreted as the "type" parameter of the load function.
But I also tried to add a type but then nothing happens since I don't read the image output.
Any idea what might be the issue ? Do I use the new version wrong ?
Thanks for the help !
The text was updated successfully, but these errors were encountered: