2024-10-05 10:21:25 +00:00
|
|
|
# sharp-read-bmp
|
2024-10-05 11:14:45 +00:00
|
|
|
Function for reading bmp and ico and returning a sharp instance
|
2024-10-05 10:21:25 +00:00
|
|
|
|
2024-10-06 01:00:51 +00:00
|
|
|
[![][mit-badge]][mit]
|
|
|
|
|
2024-10-05 11:14:45 +00:00
|
|
|
Installation
|
|
|
|
----------------------------------------------------------------
|
|
|
|
```
|
|
|
|
npm install @valkyriecoms/sharp-read-bmp
|
|
|
|
```
|
|
|
|
|
|
|
|
Usage
|
|
|
|
----------------------------------------------------------------
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
import { sharpBmp } from 'sharp-read-bmp';
|
|
|
|
import { fileTypeFromFile } from 'file-type';
|
|
|
|
|
|
|
|
const { mime } = await fileTypeFromFile('favicon.ico');
|
|
|
|
const sharpCtx = await sharpBmp('favicon.ico', mime);
|
|
|
|
|
|
|
|
console.log(await sharpCtx.metadata());
|
|
|
|
```
|