【问题标题】:imagemagick return file format using identifyimagemagick 使用识别返回文件格式
【发布时间】:2011-03-20 08:42:58
【问题描述】:

当前我能够使用identify -verbose filename.hpg 获取文件格式,我从数组中获取Format: JPEG (Joint Photographic Experts Group JFIF format)

如何使用 -format 选项返回完全相同的行, 示例:identify -verbose -format "%XXX" filename.hpg 而 XXX 是返回 Format: JPEG (Joint Photographic Experts Group JFIF format) 的格式字符

【问题讨论】:

  • 您能具体说明您想要达到的目标吗?你想要的最终结果是什么?

标签: php image imagemagick file-type identify


【解决方案1】:

您可以更简单地这样做:

exec("identifiy -verbose filename.hpg | grep Format:")

或使用http://www.imagemagick.org/script/escape.php 中记录的格式字符串序列 - 但似乎没有文本类型描述的等价物。

exec("identify -format 'Format: %m' filename.hpg");

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-12-05
    • 1970-01-01
    • 1970-01-01
    • 2013-09-12
    • 2018-02-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多