GraphicsMagick:此图像格式无解码代理

4

我在OSX 10.9上安装了GM。执行gm version会输出以下内容:

GraphicsMagick 1.3.18 2013-03-10 Q8 http://www.GraphicsMagick.org/
Copyright (C) 2002-2013 GraphicsMagick Group.
Additional copyrights and licenses apply to this software.
See http://www.GraphicsMagick.org/www/Copyright.html for details.

Feature Support:
  Thread Safe              yes
  Large Files (> 32 bit)   yes
  Large Memory (> 32 bit)  yes
  BZIP                     yes
  DPS                      no
  FlashPix                 no
  FreeType                 no
  Ghostscript (Library)    no
  JBIG                     no
  JPEG-2000                no
  JPEG                     no
  Little CMS               no
  Loadable Modules         no
  OpenMP                   no
  PNG                      no
  TIFF                     no
  TRIO                     no
  UMEM                     no
  WMF                      no
  X11                      no
  XML                      yes
  ZLIB                     yes

Host type: x86_64-apple-darwin13.0.0

Configured using the command:
  ./configure 

Final Build Parameters:
  CC       = gcc
  CFLAGS   = -g -O2 -Wall -D_THREAD_SAFE
  CPPFLAGS = -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/libxml2
  CXX      = g++
  CXXFLAGS = -D_THREAD_SAFE
  LDFLAGS  = -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib
  LIBS     = -lbz2 -lxml2 -lz -lm -lpthread

尝试执行以下命令:
String[] commands = new String[]{"identify", "-format", "%h|%w|%b|%t|%e", image_file.getAbsolutePath()};
返回错误信息:
org.gm4java.engine.GMException: identify: No decode delegate for this image format (/Users/latu/Desktop/vent.tiff)。
根据版本输出,我认为某些原因禁用了TIFF支持,但我似乎找不到解决方案。我还尝试直接从终端执行命令(gm identify path),但返回相同的错误消息。如果您能提供任何关于可能导致此问题的反馈,将不胜感激。
更新:
我已安装tiff、zlib和jpeg库,但在运行./configure时仍然出现此问题。
checking for TIFF support ... 
checking tiff.h usability... no
checking tiff.h presence... no
checking for tiff.h... no
checking tiffio.h usability... no
checking tiffio.h presence... no
checking for tiffio.h... no
checking for TIFFOpen in -ltiff... no
checking for TIFFClientOpen in -ltiff... no
checking for TIFFIsByteSwapped in -ltiff... no
checking for TIFFReadRGBATile in -ltiff... no
checking for TIFFReadRGBAStrip in -ltiff... no
checking if TIFF package is complete... no

你安装了libtiff吗?你可能也想确保你同时安装了libpng。 - JimB
我下载并安装了tiff-4.0.3(libtiff)、zlib和jpegsr9代理。尽管似乎没有任何区别。如果我运行./configure,当它正在寻找tiff时,它不会检测到任何内容。 - Giannis
你不需要GM的jpegsr9版本,jpeg8仍然是首选版本(你的系统应该有)。如果你没有将它们安装在/usr/local中,并且头文件在/usr/local/include中,你需要告诉configure去哪里查找。你也可以使用homebrew通过单个brew install graphicsmagick轻松安装所有内容。Homebrew还可以帮助你解决构建环境的一般问题。 - JimB
@JimB 在编译 gm 时,使用 ./configure CC=clang 是解决方案。 - Giannis
可能这是一个特定于10.9版本的问题。 - Giannis
显示剩余2条评论
2个回答

5

通过这个SO答案,另一个解决方案是:ImageMagick无解码代理

对我有用的是:

  1. brew install libtiff 确保安装了libtiff
  2. brew install graphicsmagick --with-libtiff

2
对于那些已经通过brew安装了graphicsmagick的用户: brew reinstall graphicsmagick --with-libtiff - Jeffrey Knight

3

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接