Error: unknown JPEG marker 494d
- Dominant language
- TypeScript
- Stars
- 14.7k
- Forks
- 777
- PR merge metrics
- No merged PRs in 30d
Description
# Expected Behavior
Would like to scale an image
# Current Behavior
When using
```
const buffer: ArrayBuffer = await getArrayBuffer(image)
const jimpImage: Jimp = await Jimp.read(Buffer.from(buffer))
```
# Failure Information (for bugs)
we get the following error
```
Error: unknown JPEG marker 494d
at constructor.parse (decoder.js:825)
at Object.decode [as image/jpeg] (decoder.js:1096)
at Jimp.parseBitmap (image-bitmap.js:165)
at Jimp.parseBitmap (index.js:400)
at new Jimp (index.js:355)
at _construct (construct.js:19)
at index.js:874
at new Promise ()
at Function.push../node_modules/@jimp/core/es/index.js.Jimp.read (index.js:873)
at FileToJimp (general_utils.ts:232)
at async scaleToFitImage (general_utils.ts:127)
at async scaleAndUploadImage (helpers.tsx:17)
at async Promise.all (index 0)
at async uploadImages (helpers.tsx:34)
at async handleSetSelectedImagesState (use_selected_images.tsx:87)
````
## Steps to Reproduce
Please try to use the following image

## Context
Trying to use this in jimpImage.scaleToFit so that i can scale an image
- Jimp Version: ^0.16.1
- Operating System: windows 10
- Node version: react: ^17.0.1
## Failure Logs
Contributor guide
Assessment
This issue has not been assessed yet.