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

A text/html be recognized as an image #60

Closed takayama-lily closed 3 years ago

takayama-lily commented 3 years ago
var probe = require('probe-image-size')
probe("https://nodejs.org/dist/latest-v14.x/docs/api/stream.html").then(console.log)

output:

{
  width: 24,
  height: 24,
  type: 'svg',
  mime: 'image/svg+xml',
  wUnits: 'px',
  hUnits: 'px',
  url: 'https://nodejs.org/dist/latest-v14.x/docs/api/stream.html'
}
puzrin commented 3 years ago

SVG inside HTML. Nice catch :).

I think, extra check for "no html/head/body patterns before " should solve problem.

rlidwka commented 3 years ago

Fixed, thanks for reporting.

puzrin commented 3 years ago

Released 7.2.0