dimapaloskin / detect-file-type Goto Github PK
View Code? Open in Web Editor NEWDetect file type by signatures.
License: Do What The F*ck You Want To Public License
Detect file type by signatures.
License: Do What The F*ck You Want To Public License
This is somewhat similar case as #21
So we have tool that allows users to upload images, and we use this library to initially identify those files as images.
Some of our users tried to upload some SVGs that had XML declaration in them, and those files were then rejected because they did not look like images.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg ...svg stuff.../></svg>
Well, it is XML, but it is also SVG.
As custom functions and added signatures are tested only if built-in signatures do not produce match, I could not fix this issue by using those methods.
Also, currently XML check is before SVG check in signatures.json, so this kind of SVG is always detected as XML.
I believe this could be made to work by first moving SVG check before XML, and then making SVG check contain handling for XML-declaration, if this is how this library should work?
And too many open files
errors are coming up
This file shows fine in browser, but dft returns null
https://lh3.googleusercontent.com/ZrzmSb1XKCnEuhbHa0JDQuWD5-J8oh96JVp-mDGWSvbNd0aK_ffppIGysoC0_RugXIxNkJSfeXdO55hcGmxNPb1XwMnLoWRhgIG_
ERROR in ./node_modules/detect-file-type/lib/index.js 3:33-46
this one doesn't work for me
https://openseauserdata.com/files/6e7103725316c19e00bdfdcf857e8bea.svg
Could some spaces affect the results?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.