h2non / filetype

Fast, dependency-free Go package to infer binary file types based on the magic numbers header signature

Home Page:https://pkg.go.dev/github.com/h2non/filetype?tab=doc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

same a video file, if run multi,get result is different

awkj opened this issue · comments

commented

the first time will get "type: mp4 MIME: video/mp4"
the second time will get "type: mov MIME: video/quicktime"

commented

That sucks. It's because Go map structure is not deterministic when iterating it in terms of the order.
The data structure should be changed into a list.

If you are interested, please send a PR.
It would be greatly appreciated since I have little time these days.

commented

That sucks. It's because Go map structure is not deterministic when iterating it in terms of the order.
The data structure should be changed into a list.

If you are interested, please send a PR.
It would be greatly appreciated since I have little time these days.

I have interseted to fix it, but I think it also have problem.
I think this movie"s extension is mp4, if i fix it ,i possible get result is "mov" ,and always get "mov", i haven"t idea to solve it.

I experienced a similar issue with ppt and doc.

commented

Hey guys, any progress on that?