Jimp stucking at a corrupted GIF file
See original GitHub issueI found this GIF file will cause Jimp stuck forever (right click to save):
Code snippet for reproducing this issue:
const Jimp = require('jimp')
Jimp.read(`1.gif`, (err, image) => {
console.log(image, err)
})
Issue Analytics
- State:
- Created 6 years ago
- Comments:6
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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 andgifwrap
.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.