我有一个java脚本,我可以在其中传递单页TIF,并且它可以正确转换为JPEG。但是,我无法确定“GraphicsMagick For Node”( https://github.com/aheckmann/gm ) 是否能够从多页 TIFF 中提取单个页面(使用“pageNumber”参数)并将其转换为 JPEG。即,导航到框架并仅提取该页面。我在这个网站上找不到其他地方。谢谢!
function GetImageAndConvert(input, output, pageNumber, idx, callback)
{
gm(input).setFormat('jpeg').noProfile().toBuffer(function(err, buffer)
{
if (!err)
{
console.log('Converted to jpeg');
}
else
{
// record error here
}
callback(buffer, idx);
});
}
最佳答案
回答我自己的问题。文档中完全错过了它:
gm("img.png").selectFrame(0)
关于javascript - GraphicsMagick For Node - 获取多页 TIF 页框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40474448/