获取应用图像处理的信息
Get info of applied image manipulation
我正在使用 gm for node。我想知道 ImageMagick CLI 命令的等效 Javascript:
convert /path/to/source.png -format "%@" info:-
这将输出 trim 数据,结果如下:
2672x3579+1115+725
我最初假设 gm 等价物是:
gm('/path/to/source.png').identify('%@', (err, result) => {
console.log(result)
})
但这只是 returns 源文件大小 没有 trim 空白。
5000x5000+0+0
这样试试:
gm convert a.png -format "%@" info:-
或者这样:
gm convert a.png -trim -format "%w %h" info:-
我想通了。
gm('/path/to/source.png')
.in('-format', '%@')
.write('info:-', (err, result) => {
console.log(result)
})
写信给 info:-
是顿悟的时刻。
我正在使用 gm for node。我想知道 ImageMagick CLI 命令的等效 Javascript:
convert /path/to/source.png -format "%@" info:-
这将输出 trim 数据,结果如下:
2672x3579+1115+725
我最初假设 gm 等价物是:
gm('/path/to/source.png').identify('%@', (err, result) => {
console.log(result)
})
但这只是 returns 源文件大小 没有 trim 空白。
5000x5000+0+0
这样试试:
gm convert a.png -format "%@" info:-
或者这样:
gm convert a.png -trim -format "%w %h" info:-
我想通了。
gm('/path/to/source.png')
.in('-format', '%@')
.write('info:-', (err, result) => {
console.log(result)
})
写信给 info:-
是顿悟的时刻。