victorperin/qr-scanner-cli

View on GitHub
src/infrastructure/jimp.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { read } from 'jimp'
import { Bitmap, Image } from '@jimp/core'

const extractBitmap = (image: Image): Bitmap => image.bitmap

export const getBitmap = (filePath: string): Promise<Bitmap> =>
  Promise.resolve(filePath).then(read).then(extractBitmap)