question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Jimp stucking at a corrupted GIF file

See original GitHub issue

I found this GIF file will cause Jimp stuck forever (right click to save):

1

Code snippet for reproducing this issue:

const Jimp = require('jimp')

Jimp.read(`1.gif`, (err, image) => {
  console.log(image, err)
})

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
jtlappcommented, Oct 10, 2017

Thanks for this. I’m writing a package that adds GIF support to Jimp by wrapping it, will see if I can fix it in my wrapping module.

0reactions
jtlappcommented, Aug 5, 2018

Oh sorry, somehow I missed the question. There are two issues related to GIF support. One is getting single frame GIFs to load at all. The problem was in omggif. I submitted the problem to omggif along with a solution, although the author opted for a different solution. Use the existing omggif repo, instead of a local copy. and this problem will go away.

The second issue with GIFs is supporting animations. Jimp is architected to operate on exactly one image at a time. All the stuff that’s needed to support GIF animations is outside the purview of Jimp. It’s stuff that would wrap Jimp. I attempted to wrap Jimp but found the Jimp constructors so non-standard that it wasn’t possible without great headache. Instead, I made a Jimp-compatible solution that allows you to copy the bitmap back and forth between Jimp and gifwrap.

I guess the final reason is that Jimp is written inefficiently and applies a mistaken understanding of async callbacks. I didn’t want to build anything on it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix animated GIF images which eog can't open, but Firefox ...
I want to be able to open all these images in eog . Can I somehow "fix" the "broken" images to make them...
Read more >
Repair corrupted GIF file (free online tool) - Ezgif
Online tool for repairing corrupted GIF files, or files which some programs can't properly open or edit. Variety of tools for GIF repair...
Read more >
Gif not working in Shopify | image is corrupt and cannot be ...
If you upload gif images to Shopify and get this message 'The uploaded image is corrupt and cannot be processed.
Read more >
How to add watermark to an animated gif image using jimp ...
If I try to open that file in mac, the popup will appear with message: "The file “animatedimg.gif” could not be opened because...
Read more >
GIFs not working - Adobe Support Community - 4400480
it will get stuck on whatever layer I show. when I unshow all the layers the ... I honestly don't know what I'm...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found