detect common map tile formats from a buffer
Given a buffer of unknown data, return either a format as an extension string or false if the type cannot be determined.
Potential options are:
- png
- pbf
- jpg
- webp
| parameter | type | description |
|---|---|---|
buffer |
Buffer | input |
Returns String,boolean, identifier
Return headers - Content-Type and Content-Encoding - for a response containing this kind of image.
| parameter | type | description |
|---|---|---|
buffer |
Buffer | input |
Returns Object, headers
Determine the width and height of an image contained in a buffer, returned as a [x, y] array.
| parameter | type | description |
|---|---|---|
buffer |
Buffer | input |
dimensions |
Array,boolean |
Requires nodejs.
$ npm install @mapbox/tiletype$ npm test