【问题标题】:GraphicsMagick: No decode delegate for this image formatGraphicsMagick:此图像格式没有解码委托
【发布时间】:2013-11-26 15:14:06
【问题描述】:

我在 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 图片格式(/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,
  • 我从代表处下载并安装了 tiff-4.0.3 (libtiff)、zlib 和 jpegsr9。虽然看起来没什么区别。如果我运行 ./configure,它在寻找 tiff 时不会检测到任何东西。
  • 您不希望 GM 使用 jpegsr9,jpeg8 仍然是首选版本(您的系统应该有)。如果您没有将它们安装在/usr/local 中,并且标头位于/usr/local/include 中,则您必须告诉 configure 去哪里寻找。您还可以使用自制软件通过单个brew install graphicsmagick 轻松安装所有这些。如果您的构建环境存在一般问题,Homebrew 也可以帮助您解决问题。
  • GraphicsMagick jconfig.h jerror.h jmorecfg.h jpeglib.h tiff.h tiffconf.h tiffio.h tiffio.hxx tiffvers.h zconf.h zlib.h 里面有 /usr/local/包括。我很可能会安装自制软件,试一试,因为我找不到如何让它工作。
  • @JimB ./configure CC=clang when making gm 是解决方案。

标签: installation graphicsmagick


【解决方案1】:

通过这个 SO 答案的另一个解决方案:ImageMagick no decode delegate

对我有用的是

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

【讨论】:

  • 对于那些已经通过 brew 安装了 graphicsmagick 的用户:brew reinstall graphicsmagick --with-libtiff
【解决方案2】:

这个问题的解决方法在这里找到:http://ext.raneous.net/post/40106080462/building-graphicsmagick-on-osx

添加./configure CC=clang 参数已解决问题,并且tiff 支持现在按预期工作。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-07-12
    • 1970-01-01
    • 2020-09-29
    • 2018-04-22
    • 2019-04-25
    • 2021-11-05
    • 1970-01-01
    相关资源
    最近更新 更多