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.

[TypeError: Corrupt JPG, exceeded buffer limits]

See original GitHub issue

Trying to calculate the following image throws an exception:

var imagesize = require("image-size");
var url = "http://www.niemanlab.org/images/renewalinvoice.jpg";
var needle = require('needle');

var stream = needle.get(url);
stream.on('readable', function( ) {
    var chunk;
    while( chunk = this.read() ) {
        info = imagesize(chunk);
        if( info ) {
            stream.end();
            console.log('streaming picture', info);
        }
    }
});
stream.on('end', function(){
    console.log('Stream ended');
});

Issue Analytics

  • State:open
  • Created 9 years ago
  • Comments:16 (1 by maintainers)

github_iconTop GitHub Comments

11reactions
kbradl16commented, Dec 18, 2015

FYI I had this error as well, but I found out it was because the images I was using were saved as CMYK file type instead of RGB. Once I changed the images to RGB the script worked.

8reactions
puzrincommented, Dec 1, 2016

try https://github.com/nodeca/probe-image-size, it works with examples from this thread

Read more comments on GitHub >

github_iconTop Results From Across the Web

Corrupt JPG, exceeded buffer limits - Stack Overflow
1. The file is too large to be processed. · 1 · @AliSheikhpour even after reducing the file size to 1.1 MB, I...
Read more >
Corrupt Jpg, Exceeded Buffer Limits - ADocLib
I got an error, TypeError: Corrupt JPG, exceeded buffer limits , when I use image-size with an JPEG image file. But when I...
Read more >
TypeError: Corrupt JPG, exceeded buffer limits - Bountysource
TypeError : Corrupt JPG, exceeded buffer limits. ... Maybe that's because the JPG is too big, but I would like to know how...
Read more >
PIL.Image - Pillow (PIL Fork) 9.3.0 documentation
If this number is exceeded, this method returns None. The default limit is 256 colors. :returns: An unsorted list of (count, pixel) values....
Read more >
original size image react native Code Example - Code Grepper
... to share file from react native · How to show content-type:image/jpg in react ... out of memory gc overhead limit exceeded. react...
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