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

Error: Command failed: gm identify: No decode delegate for this image format #590

Open
olalonde opened this issue Oct 19, 2016 · 4 comments

Comments

@olalonde
Copy link

When trying to convert a PSD to a PNG, I am getting this error:

Error: Command failed: gm identify: No decode delegate for this image format (/var/folders/67/wj749ptn3jlb4_nlf9nphyy00000gn/T/gmegI596).
gm identify: Request did not return an image.

    at ChildProcess.onExit (/Users/olalonde/code/project/node_modules/gm/lib/command.js:301:17)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Socket.<anonymous> (internal/child_process.js:334:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:493:12)

It is working fine for other image types however. I tried $ convert -format png test/files/kitty.psd preview.png in the console and that works.

@olalonde
Copy link
Author

olalonde commented Oct 19, 2016

Code to reproduce:

import gm from 'gm'
import { join } from 'path'
import kitchenfile from 'kitchenfile'

const file = kitchenfile(join(__dirname), './files')

const kitty = file('kitty.psd')

gm(kitty.rs()).identify((err, result) => {
  console.log(err)
  console.log(result)
})

where files/kitty.psd is https://github.com/sindresorhus/file-type/blob/master/fixture/fixture.psd

@olalonde
Copy link
Author

Narrowed down the problem a bit with DEBUG=gm. Now able to reproduce error in console.

This works:

cat test/files/kitty.psd | identify -

but this doesn't

cat test/files/kitty.psd | /usr/local/bin/gm identify -

So I guess identify is imagemagick and not graphicsmagick. And I suppose my graphicsmagick installation (brew install graphicsmagick) does not support PSDs?

@olalonde
Copy link
Author

Opened issue on Homebrew: Homebrew/homebrew-core#6072

@JustinYi922
Copy link

JustinYi922 commented May 11, 2017

您好。我在unbutu上也遇到了这个问题。在Mac上,运行确实正常的。
Error: Command failed: gm identify: No decode delegate for this image format (images/bd.png).
gm identify: Request did not return an image

找了很久的方法。在头部
var fs = require('fs')
, gm = require('gm');
改为
var fs = require('fs')
, gm = require('gm').subClass({imageMagick: true});

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

2 participants