Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot write GIFs to file. #1000

Closed
EliasVal opened this issue Apr 6, 2021 · 2 comments
Closed

Cannot write GIFs to file. #1000

EliasVal opened this issue Apr 6, 2021 · 2 comments
Labels
bug there is a bug in the way jimp behaves GIF Support help wanted

Comments

@EliasVal
Copy link

EliasVal commented Apr 6, 2021

Expected Behavior

Write GIF to file

Current Behavior

It crashes, for seemingly no reason.

Failure Information (for bugs)

I tried manipulating a PNG and writing it and it worked, but as soon as I tried any GIF, it crashes.

Steps to Reproduce

  1. jimp.read() an image
  2. modify it (optional)
  3. write it to a file with a .gif extension

Code:

jimp.read(/* PATH TO IMAGE */, (err, img) => {
    if (err) throw err;
    img.write(`./gif.gif`)                
})

Context

  • Jimp Version: v0.16.1
  • Operating System: Windows 10 20H2 Build 19042.867
  • Node version: v14.15.0

Failure Logs

_stream_writable.js:285

TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received an instance of Promise
    at WriteStream.<anonymous> (F:\Projects - PATH\node_modules\@jimp\core\dist\index.js:589:18)
    at WriteStream.emit (events.js:315:20)
    at internal/fs/streams.js:380:12
    at FSReqCallback.oncomplete (fs.js:171:23) {
  code: 'ERR_INVALID_ARG_TYPE'
}
@mkimbo
Copy link

mkimbo commented Dec 12, 2021

Any solution to this? My jimp implementation also reads and writes jpegs/pngs but gifs are not written.. the resulting file from uploading/writing a new gif is empty

@natqe
Copy link

natqe commented Dec 30, 2021

same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug there is a bug in the way jimp behaves GIF Support help wanted
Projects
None yet
Development

No branches or pull requests

4 participants