nodeca / probe-image-size

Get image size without full download. Supported image types: JPG, GIF, PNG, WebP, BMP, TIFF, SVG, PSD, ICO.
MIT License
988 stars 77 forks source link

ProbeError: ECONTENT unrecognized file format #21

Closed timomitt2610 closed 6 years ago

timomitt2610 commented 6 years ago

I am using probe-image-size@4.0.0 and I have the following code:

var probe = require('probe-image-size');
probe(url, function(err, res) {
    if (err) {
        console.error(err);
    }
});

I get the following error with this image: http://www.4usky.com/data/out/72/164647502-porsche-cayenne-wallpapers.jpg

{ Error
    at Transform.parserEnd (C:\project\node_modules\probe-image-size\stream.js:29:24)
    at Object.onceWrapper (events.js:291:19)
    at emitNone (events.js:91:20)
    at Transform.emit (events.js:186:7)
    at endReadableNT (_stream_readable.js:974:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
  name: 'ProbeError',
  message: 'unrecognized file format',
  code: 'ECONTENT' }
puzrin commented 6 years ago

That url is not valid (not image). So - works as expected.

timomitt2610 commented 6 years ago

Thank you for your quick reply! Now it redirects me as well. It did not do it before and opened the image right away.

puzrin commented 6 years ago

When you have a reproducible example of broken image - just open a new ticket with it.

timomitt2610 commented 6 years ago

I thought I had, because my browser opened the image with no problems. It does not anymore.