'use strict';

function isBMP (buffer) {
  return ('BM' === buffer.toString('ascii', 0, 2));
}

function calculate (buffer) {
  return {
    'width': buffer.readUInt32LE(18),
    'height': buffer.readUInt32LE(22)
  };
}

module.exports = {
  'detect': isBMP,
  'calculate': calculate
};

@@ -182,16 +182,25 @@
 eight': 
+Math.abs(
 buffer.r
@@ -194,33 +194,32 @@
 .abs(buffer.read
-U
 Int32LE(22)%0A  %7D;
@@ -213,16 +213,17 @@
 32LE(22)
+)
 %0A  %7D;%0A%7D%0A

support both traditional BMP & BMP-V3