How to use utif - 10 common examples

To help you get started, we’ve selected a few utif examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / types / utif / utif-tests.ts View on Github external
import * as UTIF from "utif";

// $ExpectType IFD[]
const IFDs = UTIF.decode(new ArrayBuffer(64));
// $ExpectType Uint8Array
const rgba = UTIF.toRGBA8(IFDs[0]);

// $ExpectType ArrayBuffer
UTIF.encodeImage(rgba, 8, 8);
// $ExpectType ArrayBuffer
UTIF.encode(IFDs);
// $ExpectType void
UTIF.decodeImage(new ArrayBuffer(64), IFDs[0]);
// $ExpectType void
UTIF.replaceIMG();
github DefinitelyTyped / DefinitelyTyped / types / utif / utif-tests.ts View on Github external
import * as UTIF from "utif";

// $ExpectType IFD[]
const IFDs = UTIF.decode(new ArrayBuffer(64));
// $ExpectType Uint8Array
const rgba = UTIF.toRGBA8(IFDs[0]);

// $ExpectType ArrayBuffer
UTIF.encodeImage(rgba, 8, 8);
// $ExpectType ArrayBuffer
UTIF.encode(IFDs);
// $ExpectType void
UTIF.decodeImage(new ArrayBuffer(64), IFDs[0]);
// $ExpectType void
UTIF.replaceIMG();
github DefinitelyTyped / DefinitelyTyped / types / utif / utif-tests.ts View on Github external
import * as UTIF from "utif";

// $ExpectType IFD[]
const IFDs = UTIF.decode(new ArrayBuffer(64));
// $ExpectType Uint8Array
const rgba = UTIF.toRGBA8(IFDs[0]);

// $ExpectType ArrayBuffer
UTIF.encodeImage(rgba, 8, 8);
// $ExpectType ArrayBuffer
UTIF.encode(IFDs);
// $ExpectType void
UTIF.decodeImage(new ArrayBuffer(64), IFDs[0]);
// $ExpectType void
UTIF.replaceIMG();
github DefinitelyTyped / DefinitelyTyped / types / utif / utif-tests.ts View on Github external
import * as UTIF from "utif";

// $ExpectType IFD[]
const IFDs = UTIF.decode(new ArrayBuffer(64));
// $ExpectType Uint8Array
const rgba = UTIF.toRGBA8(IFDs[0]);

// $ExpectType ArrayBuffer
UTIF.encodeImage(rgba, 8, 8);
// $ExpectType ArrayBuffer
UTIF.encode(IFDs);
// $ExpectType void
UTIF.decodeImage(new ArrayBuffer(64), IFDs[0]);
// $ExpectType void
UTIF.replaceIMG();
github DefinitelyTyped / DefinitelyTyped / types / utif / utif-tests.ts View on Github external
import * as UTIF from "utif";

// $ExpectType IFD[]
const IFDs = UTIF.decode(new ArrayBuffer(64));
// $ExpectType Uint8Array
const rgba = UTIF.toRGBA8(IFDs[0]);

// $ExpectType ArrayBuffer
UTIF.encodeImage(rgba, 8, 8);
// $ExpectType ArrayBuffer
UTIF.encode(IFDs);
// $ExpectType void
UTIF.decodeImage(new ArrayBuffer(64), IFDs[0]);
// $ExpectType void
UTIF.replaceIMG();
github DefinitelyTyped / DefinitelyTyped / types / utif / utif-tests.ts View on Github external
import * as UTIF from "utif";

// $ExpectType IFD[]
const IFDs = UTIF.decode(new ArrayBuffer(64));
// $ExpectType Uint8Array
const rgba = UTIF.toRGBA8(IFDs[0]);

// $ExpectType ArrayBuffer
UTIF.encodeImage(rgba, 8, 8);
// $ExpectType ArrayBuffer
UTIF.encode(IFDs);
// $ExpectType void
UTIF.decodeImage(new ArrayBuffer(64), IFDs[0]);
// $ExpectType void
UTIF.replaceIMG();
github oliver-moran / jimp / packages / type-tiff / src / index.js View on Github external
[MIME_TYPE]: data => {
      const ifds = UTIF.decode(data);
      const page = ifds[0];
      UTIF.decodeImages(data, ifds);
      const rgba = UTIF.toRGBA8(page);

      return {
        data: Buffer.from(rgba),
        width: page.t256[0],
        height: page.t257[0]
      };
    }
  },
github oliver-moran / jimp / packages / type-tiff / src / index.js View on Github external
[MIME_TYPE]: image => {
      const tiff = UTIF.encodeImage(
        image.bitmap.data,
        image.bitmap.width,
        image.bitmap.height
      );

      return Buffer.from(tiff);
    }
  }
github oliver-moran / jimp / packages / type-tiff / src / index.js View on Github external
[MIME_TYPE]: data => {
      const ifds = UTIF.decode(data);
      const page = ifds[0];
      UTIF.decodeImages(data, ifds);
      const rgba = UTIF.toRGBA8(page);

      return {
        data: Buffer.from(rgba),
        width: page.t256[0],
        height: page.t257[0]
      };
    }
  },
github oliver-moran / jimp / packages / type-tiff / src / index.js View on Github external
[MIME_TYPE]: data => {
      const ifds = UTIF.decode(data);
      const page = ifds[0];
      UTIF.decodeImages(data, ifds);
      const rgba = UTIF.toRGBA8(page);

      return {
        data: Buffer.from(rgba),
        width: page.t256[0],
        height: page.t257[0]
      };
    }
  },

utif

Fast and advanced TIFF decoder

MIT
Latest version published 5 years ago

Package Health Score

68 / 100
Full package analysis