簡體   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