source: trip-planner-front/node_modules/image-size/lib/types/bmp.js

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 296 bytes
RevLine 
[6a3a178]1'use strict';
2
3function isBMP (buffer) {
4 return ('BM' === buffer.toString('ascii', 0, 2));
5}
6
7function calculate (buffer) {
8 return {
9 'width': buffer.readUInt32LE(18),
10 'height': Math.abs(buffer.readInt32LE(22))
11 };
12}
13
14module.exports = {
15 'detect': isBMP,
16 'calculate': calculate
17};
Note: See TracBrowser for help on using the repository browser.