Imagick is unable to open DNG images

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 12:00:05

问题


As you can see, the image _IGP4559.DNG exists but Imagick can't open it. JPEG images works just fine.
readImage() returns the same error.

Here is the image: http://files.patrikelfstrom.se/_IGP4559.DNG

I run this in the terminal to rule out all other variables.

$ ll /var/www/_IGP4559.DNG
-rw-rw-rw- 1 monsun monsun 11841201 May 17 03:37 /var/www/_IGP4559.DNG
$ php -a
Interactive mode enabled

php > new Imagick('/var/www/_IGP4559.DNG');
PHP Warning:  Uncaught exception 'ImagickException' with message 'unable to open image `/tmp/magick-29917oe6CM9MIkN8A.ppm': No such file or directory @ error/blob.c/OpenBlob/2709' in php shell code:1
Stack trace:
#0 php shell code(1): Imagick->__construct('/var/www/_IGP45...')
#1 {main}
  thrown in php shell code on line 1


回答1:


ImageMagick uses other programs to read some image formats, including DNG.

What is likely happening is that the program that ImageMagick expects to be able to use to read the DNG either isn't present on your system or isn't working correctly.

The file that lists these other programs is called delegates.xml

On my system the entry for DNG decoding is:

<delegate decode="dng:decode" command="&quot;ufraw-batch&quot; --silent --create-id=also --out-type=png --out-depth=16 &quot;--output=%u.png&quot; &quot;%i&quot;"/>

i.e. it's trying to use the program 'ufraw-batch' to do the decoding, and like you're seeing it fails, as that program isn't usable on my system.

To solve this, you either need to install ufraw, or install a similar package that can convert files from the DNG format to a standard one that ImageMagick can read directly.



来源:https://stackoverflow.com/questions/30282523/imagick-is-unable-to-open-dng-images

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!