【文件属性】:
文件名称:is-tif:检查BufferUint8Array是否为TIFF图像
文件大小:212KB
文件格式:ZIP
更新时间:2021-05-26 08:08:19
JavaScript
is-tif
检查Buffer / Uint8Array是否为图像
安装
$ npm install is-tif
用法
Node.js
const readChunk = require ( 'read-chunk' ) ;
const isTif = require ( 'is-tif' ) ;
const buffer = readChunk . sync ( 'unicorn.tif' , 0 , 4 ) ;
isTif ( buffer ) ;
//=> true
浏览器
const xhr = new XMLHttpRequest ( ) ;
xhr . open ( 'GET' , 'unicorn.tif' ) ;
xhr . responseType = 'arraybuffer' ;
xhr . onload = ( ) => {
isTif ( new U
【文件预览】:
is-tif-main
----fixture.png(53KB)
----.gitignore(23B)
----.github()
--------workflows()
----fixture-big-endian.tif(105KB)
----.gitattributes(29B)
----package.json(649B)
----readme.md(826B)
----index.js(285B)
----fixture-little-endian.tif(101KB)
----test.js(305B)
----.editorconfig(175B)
----license(1KB)
----.npmrc(19B)