Open lukaprijatelj opened 1 week ago
Description of the error in console /repo/node_modules/gm/lib/command.js:318 err = new Error('Command failed: ' + stderr); ^
Error: Command failed: gm convert: Improper image header (/var/folders/cs/l780tq_j2f70ml2j7qxzyp3w0000gp/T/gmCFO1v4). at ChildProcess.onExit (/repo/node_modules/gm/lib/command.js:318:17) at ChildProcess.emit (node:events:520:28) at maybeClose (node:internal/child_process:1105:16) at Socket. (node:internal/child_process:457:11) at Socket.emit (node:events:520:28) at Pipe. (node:net:337:12) { code: 1, signal: null }
To Reproduce Steps to reproduce the behavior:
Versions:
Pdf I am trying to convert is very minimal 1 test page that I made from Word and is not protected! Please help! No idea what I am doing wrong!
========== My code: const options = { saveFilename: "untitled", savePath: "./images", }; const convert = fromPath(filePath, options); const pageToConvertAsImage = 1;
convert(pageToConvertAsImage, { responseType: "image" }) .then((resolve) => { console.log("Page 1 is now converted as image"); return resolve; });
Hi @lukaprijatelj, can you try your code with another PDF? Maybe pdf1 from this repository https://github.com/yakovmeister/pdf2image/blob/master/test/data/pdf1.pdf
Nop. Same issue.
Description of the error in console /repo/node_modules/gm/lib/command.js:318 err = new Error('Command failed: ' + stderr); ^
Error: Command failed: gm convert: Improper image header (/var/folders/cs/l780tq_j2f70ml2j7qxzyp3w0000gp/T/gmCFO1v4). at ChildProcess.onExit (/repo/node_modules/gm/lib/command.js:318:17) at ChildProcess.emit (node:events:520:28) at maybeClose (node:internal/child_process:1105:16) at Socket. (node:internal/child_process:457:11)
at Socket.emit (node:events:520:28)
at Pipe. (node:net:337:12) {
code: 1,
signal: null
}
To Reproduce Steps to reproduce the behavior:
Versions:
Pdf I am trying to convert is very minimal 1 test page that I made from Word and is not protected! Please help! No idea what I am doing wrong!
========== My code: const options = { saveFilename: "untitled", savePath: "./images", }; const convert = fromPath(filePath, options); const pageToConvertAsImage = 1;
convert(pageToConvertAsImage, { responseType: "image" }) .then((resolve) => { console.log("Page 1 is now converted as image"); return resolve; });