繁体   English   中英

GraphicsMagick For Node-获取多页TIF页面框架

[英]GraphicsMagick For Node - Get Multi-Page TIF Page Frame

我有一个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)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM