jimp-dev/jimp

Error: unknown JPEG marker 494d

Open

#994 opened on Mar 12, 2021

View on GitHub
 (0 comments) (1 reaction) (0 assignees)JavaScript (13,218 stars) (785 forks)batch import
bughelp wanted

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 (<anonymous>)
    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)

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