dmnsgn / canvas-screenshot

A one trick pony package to download an image from a canvas.

Home Page:https://dmnsgn.github.io/canvas-screenshot/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong extension detection if path includes folder name

vorg opened this issue · comments

I was wondering why my jpg files are actually png inside and it turns out that...

var fileExtension = require("file-extension")
console.log(fileExtension("bla.jpg")) -> 'jpg'
console.log(fileExtension("bla\bla.jpg")) -> 'undefined'

Actually issue was somewhere else as i was using toBlob and not providing file name...

Closing as filenames assigned to the html link element download property can't be path.