jimp-dev/jimp

Error: unknown JPEG marker 494d

オープン

#994 opened on 2021/03/12

 (0 件のコメント) (1 件のリアクション) (0 人の担当者)JavaScript (785 件のフォーク)batch import
bughelp wanted

Repository metrics

Stars
 (13,218 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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

コントリビューターガイド