开发者

imagemagick return file format using identify

开发者 https://www.devze.com 2023-02-18 03:08 出处:网络
Cu开发者_JS百科rrent I am able to get the file format using identify -verbose filename.hpg, I get Format: JPEG (Joint Photographic Experts Group JFIF format) from the array.

Cu开发者_JS百科rrent I am able to get the file format using identify -verbose filename.hpg, I get Format: JPEG (Joint Photographic Experts Group JFIF format) from the array.

How can I return this exact same line using the -format option, example: identify -verbose -format "%XXX" filename.hpg whereas XXX is the format charcter to return Format: JPEG (Joint Photographic Experts Group JFIF format)


You can more simply do this:

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

Or use the format string sequences as documented in http://www.imagemagick.org/script/escape.php - but there's seemingly no equivalent for the textual type description.

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

精彩评论

暂无评论...
验证码 换一张
取 消