1

使用带有nodejs的imagemagick,我想用xy按列和行重命名我的输出。

我可以在终端上做,但我怎么能在我的脚本上实现它。

终端示例:

convert img.jpg -crop 512x512 -set filename:tile ./tiles/pano-%[fx:page.x/256]-%[fx:page.y/256] %[filename:tile]-0.jpg

var args = [
  query.url+".jpg",          // image 
  "-crop",            // will crop the tiles
  "512x512",          // size of tile will be created
  query.url+"/output.jpg"        // Image output name.
];

im.convert(args, function(err) {
    if(err) { throw err; }
    res.end("Image crop complete");
  });

}

或者你能建议我用其他方法来平铺我的图像吗?

4

1 回答 1

0

好的,我找到了解决方案,如果他们需要,这可能对其他人有所帮助。

var args = [
  query.url+".jpg",   // image location
  "-crop",            // will crop the tiles
  "512x512",
  "-set",
  "filename:tile",
  query.url+"/pano-%[fx:page.x/512]-%[fx:page.y/512]",         
  "%[filename:tile]-0.jpg"

];
于 2015-08-10T12:49:49.303 回答