Open olalonde opened 7 years ago
haha. Here is error:
cropImg err: { Error: Command failed: gm identify: Insufficient image data in file (image-temp.jpg).
gm identify: Request did not return an image.
cropImg err: { Error: Command failed: gm identify: Empty input file (image-temp.jpg).
gm identify: Request did not return an image.
cropImg err: { Error: Command failed: gm identify: Not a JPEG file: starts with 0x00 0x00 (image-temp.jpg).
gm identify: Request did not return an image.
I try to crop lots of imgs, don't know how to track the debugger.
Error: Command failed: gm identify: Unable to open file (/tmp/gm4yFeyx) [Invalid argument].
gm identify: Request did not return an image.
const convertPDFToImages = async (
pdfFile: Express.Multer.File
) => {
const options = {
density: 300,
width: 1200,
height: 1800,
format: 'png',
savePath: pdfFile.destination,
saveFilename: pdfFile.filename.replace(/\.[^/.]+$/, ''),
};
const convert = fromPath(pdfFile.path, options);
try {
const images = await convert.bulk(-1);
console.log('images==>', images);
} catch (error) {
console.error('Error during conversion:', error);
}
}
The issue occurs intermittently during the conversion of a PDF file to PNG images using GraphicsMagick (gm) within a Node.js environment. The error message suggests a problem with opening the temporary file (/tmp/gm4yFeyx) and indicates that the identify request did not return an image.
After switching to an alpine based image in docker, I'm getting this error:
Posting here in case anyone faced that issue before.