Comments (4)
What we could do there is instead of matching at offset 0 and FORM we can change to the offset where the more accurate info lives and match there instead.
Don't currently have a way to do wildcards, so can't be as accurate matching both FORM and ACBM
Thanks for the info, I can work on that when I have time. If you know a source of sample files for that please share!
from puremagic.
Thanks for the samples! Added a multi-part detect.
Should be working in 1.20 https://github.com/cdgriffith/puremagic/releases/tag/1.20
from puremagic.
Nice! I've just looked at the implementation and that's way a great way to handle it, much tidier than mine. I'll test it out later on a script I have for handling converting images between formats.
For retro uses this will be handy as there are a lot of older formats like file packers that use a two part fingerprint.
from puremagic.
Instead or in addition to wildcards another option could be dual match, take our .iff sample, we could look to do...
[["464f524d","494c424d"], [0,8], "", "application/x-iff", "IFF file"],
If your code sees a list instead of a string, process both hex matches using the matching offset from the next list, if both matches, we get pretty much 100% confidence it's what we think it is. Logic is a little weirder than wildcarding but it's another possible way.
Aminet is pretty much the internet oldest resource for all things Amiga, we should be able to find pretty much all things there.
7zip will happily unpack most of the .lha and other formats you'll find there. If you get stuck on any let me know and I'm sure I can unearth samples from somewhere.
from puremagic.
Related Issues (20)
- Price-matching other repos for more file support HOT 1
- mimetype from stream HOT 1
- Confidence/Selection logic question HOT 2
- Remove unsupported Python stuff HOT 1
- same (mp3) file, different name ... different output: mp3 versus koz HOT 7
- Is it possible to use filehandles / bytestream? HOT 2
- SVG images not recogniced HOT 1
- missing mime type for webp HOT 1
- Webp image mime type is empty HOT 2
- .epub listed as "INI Config file" in magic_data.json HOT 1
- Adding JPEG-XL Support HOT 2
- JPEG XS Two mime types HOT 4
- Multi-part checks with negative offset for second match HOT 1
- EncodingWarning when PYTHONWARNDEFAULTENCODING HOT 2
- imghdr matches in PureMagic? HOT 4
- Variant field in magic.json?
- Version 2.0 Goals HOT 2
- Speed Improvements HOT 5
- For Python 3.13: A drop-in replacement for `imghdr.what()` HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from puremagic.