-
-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Info Needed: Why Partial Match and what it does? #12
Comments
Sorry for the delay on this @se7en007 . The partial match is needed because in magic files, often there are multiple matches and later ones may be better. For example, SVG images are XML matches but the SVG+XML match is better. |
I sold my 256.com domain a while back. I should have migrated all of those links to 256stuff.com. Which URL are you talking about that has out of date links? |
It should return good information. Can you give me an example of where it doesn't? |
No worries for the delay. The library gives partial match on webp files. So, read from google docs that webp files are in RIFF container. If I run on webp files, it gives 1472812600656_679_92337e55-d140-4da1-8c79-94582c05ad61_540x360.webp.zip For now I am using workaround:
|
At https://github.com/j256/simplemagic/wiki, only 2 links : central maven repository and github works. Rest all down. |
Fixed thanks. |
Hey, can you turn the WEBP request into another issue so I can track it right? Thanks. |
Done and thank you. One question, will you release a new version of library, or just patched the current version to maven? |
I've got a bad bug that I'm looking at now and I hope to release a new version once that's done.
|
No hurries. Thank you once again. |
1.7 has been released. http://repo1.maven.org/maven2/com/j256/simplemagic/simplemagic/1.7/ |
Hi Gray,
First of all, thank you for providing this small and to the point library. Amazing.
I have been checking the code and it looks like the Mime Type that is returned could be only a partial match:- MagicEntries.java:140.
Problem:- I am using your library to check mime type of the image file and then processing according to the content type(JPEG/PNG). Now, if partial match makes an image(unknown extension) match to of JPEG/PNG/any other common image format, the processing could end up being incorrect.
I have two questions to solve this problem :-
a. What was the need of Partial Match?
b. When Partial Match happens, what happens to ContentType - Multiple Values/Single Value always?
My Guess:
MIME information is stored as few bytes at the start of the file. You have a possibly a trie with all mime types. You are checking for mime of file in the trie and if the mime is not found, but starting few bytes of the file matched to a path in the trie, you append all leaf nodes under the path in that tree (Mime type starting with the same prefix as of mime of the file).
FYI:
Documentation in github wiki seems to point to urls which redirect to external websites.
Checked at http://www.redirect-checker.org/index.php
Output:
http://256.com
301 Moved Permanently
http://www.jinpai.com/Home/OnlineBid/buyout_details/mid/24379.html
200 OK
The text was updated successfully, but these errors were encountered: