将TIFF转换为PNG并在浏览器中显示

时间:2018-11-04 22:27:23

标签: javascript html tiff

由于tiff无法在大多数浏览器中显示,因此我正在考虑将其传输到png并以html显示png。我怎样才能做到这一点?谢谢!

1 个答案:

答案 0 :(得分:0)

尝试使用此库。 https://www.npmjs.com/package/tiff-to-png

var ConvertTiff = require('tiff-to-png');

var options = {
logLevel: 1
};

var converter = new ConvertTiff(options);

var tiffs = [
  '/home/tiffs/document_one.tif',
  '/home/tiffs/document_two.tif'
];
var location = '/srv/www/mysite/public/documents';

converter.convertArray(tiffs, location);