Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command failed: gm convert: No decode delegate for this image format #102

Open
suyash-purwar opened this issue Jul 5, 2021 · 9 comments

Comments

@suyash-purwar
Copy link

I am getting this error when I use the exact code written in the npm documentation's first example.

Error: Command failed: gm convert: No decode delegate for this image format (C:\Users\acer\AppData\Local\Temp\gmnP1bMn).

    at ChildProcess.onExit (D:\Suyash\Work\pennywise\pdf-manipulation\node_modules\gm\lib\command.js:301:17)
    at ChildProcess.emit (events.js:315:20)
    at ChildProcess.cp.emit (D:\Suyash\Work\pennywise\pdf-manipulation\node_modules\cross-spawn\lib\enoent.js:40:29)
    at maybeClose (internal/child_process.js:1048:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5) {
  code: 1,
  signal: null
}

I am using windows 10 64-bit architecture and have installed the following and added them in window's path:

  • GraphicsMagick-1.3.36-Q8-win64-dll
  • gs952w64

What am I doing wrong? @yakovmeister

@yakovmeister
Copy link
Owner

Hi @suyash-purwar , will you be able to provide a snippet of your code?

@suyash-purwar
Copy link
Author

Thanks for responding! Here's the snippet

const { fromPath } = require('pdf2pic');

const options = {
  density: 100,
  saveFilename: "untitled",
  savePath: "./images",
  format: "png",
  width: 600,
  height: 600
};

// Path to pdf is different in my case but  it's of this exact format
const storeAsImage = fromPath("/path/to/pdf/sample.pdf", options);
const pageToConvertAsImage = 1;

storeAsImage(pageToConvertAsImage).then((resolve) => {
  console.log("Page 1 is now converted as image");

  return resolve;
});

@yakovmeister
Copy link
Owner

@suyash-purwar , have you tried the solution mentioned in this page? https://stackoverflow.com/questions/66732199/how-to-fix-the-graphicsmagik-error-gm-convert-no-decode-delegate-for-this-imag

@suyash-purwar
Copy link
Author

Hey @yakovmeister

I am having a problem installing the fonts. Below is the image of the prompt.
Capture

@yakovmeister
Copy link
Owner

@suyash-purwar Hmmm.. I'm not sure why it's not installing. Can you try converting those fonts to .ttf format and install the .ttf font format?

@suyash-purwar
Copy link
Author

I'll try and will get back to you asap. Thanks a lot!

@suyash-purwar
Copy link
Author

suyash-purwar commented Jul 12, 2021

@yakovmeister Converted the .pfb files to .tff format and installed them successfully. Error is still there.
This is the pdf I'm trying to convert.
input-pdf.pdf

@LuisSic
Copy link

LuisSic commented Jul 11, 2022

I'm getting the same issue with a specific pdf. Did you find any solution for this? @suyash-purwar. @yakovmeister
I'm using Ubuntu 20.04 LTS and GraphicsMagick 1.3.35 2020-02-23

@hunha
Copy link

hunha commented Sep 15, 2023

I've got the same issue. Using this GraphicsMagick version fix the problem: GraphicsMagick-1.3.31-Q8-win64-dll
Maybe the newer version isn't compatible with gs952w64.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants