jimp-dev / jimp-dev/jimp

Error: unknown JPEG marker 494d

Open
#994 0 comments 1 reaction 0 assignees View on GitHub
bug help wanted
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
![AC 4k (1)](https://user-images.githubusercontent.com/24319526/110927931-906d2500-8326-11eb-8c8f-344f072029be.jpg)

## 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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.