jimp-dev/jimp

Error: unknown JPEG marker 494d

開放

#994 建立於 2021年3月12日

 (0 則留言) (1 個反應) (0 位負責人)JavaScript (785 個分叉)batch import
bughelp wanted

倉庫指標

星標
 (13,218 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

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

貢獻者指南