nodeca / probe-image-size

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

Unrecognized file format error in 4.0.0 #31

Closed yhon-acurio closed 5 years ago

yhon-acurio commented 5 years ago

Issue

Logs

error: controllers/utils-api-controller image-size.error Error while getting url: https://prod.media.larepublica.pe/1200x630/larepublica/imagen/2018/04/28/noticia-34-4-cm-estadio-elias-aguirre_watermark.jpg message=unrecognized file format, stack=ProbeError: unrecognized file format
    at ParserStream.parserEnd (/Users/yhon/development/env-9000/limber-public/node_modules/probe-image-size/stream.js:29:24)
    at Object.onceWrapper (events.js:277:13)
    at ParserStream.emit (events.js:189:13)
    at endReadableNT (_stream_readable.js:1125:12)
    at process._tickCallback (internal/process/next_tick.js:63:19), name=ProbeError, code=ECONTENT
    1) https://prod.media.larepublica.pe/1200x630/larepublica/imagen/2018/04/28/noticia-34-4-cm-estadio-elias-aguirre_watermark.jpg returns body different than null
puzrin commented 5 years ago

Reproduced:

node ./support/dump.js https://prod.media.larepublica.pe/1200x630/larepublica/imagen/2018/04/28/noticia-34-4-cm-estadio-elias-aguirre_watermark.jpg
{ ProbeError: unrecognized file format
    at ParserStream.parserEnd (/home/vitaly/Загрузки/probe-image-size/stream.js:29:24)
    at Object.onceWrapper (events.js:277:13)
    at ParserStream.emit (events.js:189:13)
    at endReadableNT (_stream_readable.js:1125:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  name: 'ProbeError',
  message: 'unrecognized file format',
  code: 'ECONTENT' }
puzrin commented 5 years ago

Fixed in https://github.com/nodeca/probe-image-size/commit/0acaa785a55925a5310ad21166e0b66a32d6f67e