nodeca / probe-image-size

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

ProbeError: unrecognized file format #61

Closed yolpsoftware closed 3 years ago

yolpsoftware commented 3 years ago

Same error as in #57, but different image:

Stacktrace:

   at ParserStream.parserEnd (my-repo\node_modules\probe-image-size\stream.js:39:28)
    at Object.onceWrapper (events.js:421:28)
    at ParserStream.emit (events.js:315:20)
    at endReadableNT (_stream_readable.js:1327:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)

Code used:

import probeImageSize from 'probe-image-size';

const result = await probeImageSize("https://upload.wikimedia.org/wikipedia/commons/8/82/Scotland_in_the_UK_and_Europe.svg");

Environment: node 14.15.1 on Windows 10 probe-image-size: 7.1.1

Other images that have the same problem:

https://upload.wikimedia.org/wikipedia/commons/3/3a/Locator_map_of_Azores_in_EU.svg
https://upload.wikimedia.org/wikipedia/commons/3/3e/EU-Portugal_with_Madeira_circled.svg
https://upload.wikimedia.org/wikipedia/commons/5/55/Gibraltar_location_in_Europe.svg
puzrin commented 3 years ago

Thanks for report.

Reason is different. Sources use namespaced format: <svg:svg ...> (i never seen it before)

puzrin commented 3 years ago

Released 7.2.0

yolpsoftware commented 3 years ago

Thanks, works perfectly.