Comments (3)
OK was curious and tried it myself.
gradle:
implementation 'com.j256.simplemagic:simplemagic:1.16'
Code:
AsyncTask.execute {
val util = ContentInfoUtil()
val input = URL("https://img.freepik.com/free-vector/abstract-dynamic-pattern-wallpaper-vector_53876-59131.jpg?size=338&ext=jpg").openStream()
val info = util.findMatch(input)
Log.d("AppLog", "info:$info")
}
And the result:
info:jpeg, type JPEG, mime 'image/jpeg', msg 'JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16'
So to answer the questions:
- Seems so.
- Working even on Android Q beta 5. Tested also on emulator with Android API 16 (4.1).
- Yes. But not sure about updates. Just need to check from time to time on the website, I guess.
- Seems not to add much. The app became 2,522KB in side, and was 2,347KB . Rising in just ~200KB, and might be smaller when used with R8 minimizer. I wonder how much it reads from the InputStream and if it can be checked somehow, and how efficient it is. Probably very efficient and barely reads data.
- This I don't know yet.
Attached here the tiny sample project.
Good job on this library!
from simplemagic.
Thanks @AndroidDeveloperLB . I need to add Gradle support to all of my libraries. Sigh. So much to do.
from simplemagic.
@j256 Can you please confirm and/or answer what I wrote ?
Is there a list somewhere of all the file-types that you support?
Does it at least include those that Android support (probably so) ?
from simplemagic.
Related Issues (20)
- Problem with detecting Illustrator file HOT 4
- CMYK Jpeg files being incorrectly read with mime-type octet-stream
- RegexType reads a line for every byte in mutableOffset.offset HOT 1
- svg is not recognized HOT 1
- Doesn't recognize bitmap files exported from GIMP HOT 5
- Bash script not recognized correctly HOT 1
- findMatch() reads too much bytes HOT 4
- Possible bug inside of MagicEntryParser HOT 4
- Slim version without internal config files HOT 2
- Support for audio/amr HOT 6
- bug: Weird identification of heic image file HOT 1
- Upgrade built-in magic file and use external on Linux HOT 1
- How to use external magic db? HOT 1
- AWS cloudfront image return as content type html HOT 2
- ContentInfoUtil.findMatch([77, 90]) generates NPE HOT 1
- pcapng filetype support
- .xls file shows null in return of getMimeType
- Can't read the correct content type for .xlsx files (application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
- Request: add nullable annotations, to know what can return null 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 simplemagic.