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
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | function isBMP (buffer) {
|
---|
4 | return ('BM' === buffer.toString('ascii', 0, 2));
|
---|
5 | }
|
---|
6 |
|
---|
7 | function calculate (buffer) {
|
---|
8 | return {
|
---|
9 | 'width': buffer.readUInt32LE(18),
|
---|
10 | 'height': Math.abs(buffer.readInt32LE(22))
|
---|
11 | };
|
---|
12 | }
|
---|
13 |
|
---|
14 | module.exports = {
|
---|
15 | 'detect': isBMP,
|
---|
16 | 'calculate': calculate
|
---|
17 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.