1 | 'use strict';
|
2 |
|
3 |
|
4 |
|
5 | var str2arr = require('../common').str2arr;
|
6 | var sliceEq = require('../common').sliceEq;
|
7 | var readUInt32BE = require('../common').readUInt32BE;
|
8 |
|
9 |
|
10 | var SIG_8BPS = str2arr('8BPS\x00\x01');
|
11 |
|
12 |
|
13 | module.exports = function (data) {
|
14 | if (data.length < 6 + 16) return;
|
15 |
|
16 |
|
17 | if (!sliceEq(data, 0, SIG_8BPS)) return;
|
18 |
|
19 | return {
|
20 | width: readUInt32BE(data, 6 + 12),
|
21 | height: readUInt32BE(data, 6 + 8),
|
22 | type: 'psd',
|
23 | mime: 'image/vnd.adobe.photoshop',
|
24 | wUnits: 'px',
|
25 | hUnits: 'px'
|
26 | };
|
27 | };
|