Comments (9)
https://github.com/JuliaWeb/URIParser.jl would be the standard for that.
from fileio.jl.
I strongly object to supporting this with plain strings βΒ it's a huge security hole and means that you can't, based on type analysis, know if code is going to try to hit the network or not! I would be in favor of using a URL type for this instead so you would do URL("https://example.com/data.csv")
. That's almost as concise and allows us to use dispatch to handle the case of fetching data.
from fileio.jl.
Eventually someone pointed me out to the "secret" ImageMagick.load_
function, and I've been a happy user ever since...
from fileio.jl.
Thanks, folks---great tips.
from fileio.jl.
I am trying to load an image from the web. Is the recommended way right now to actually save the data to a file and then load from the file? I would like to decode straight from the file contents in memory. Is there any plan to support something like this with ImageMagick, or is it a better idea to just go for a wrapper to the C libraries?
from fileio.jl.
Perhaps we should add URIParser
as a Requires dependency and have this download the file to a temporary location. Thoughts? Care to tackle it @nlw0?
from fileio.jl.
It is practically really not as simple as it might seem for FileIO.jl to handle this with just the URI.
Because the file-extension often matters for how FileIO works.
And getting the filename (and thus extension) is more complex than one might think.
The first half (about 70lines) of this file is dedicated to using HTTP.jl's systems to work it out.
And it still has edge cases it gets wrong (e.g. you are allowed to use fairly arbitrary character set encodings for some of the fields)
https://github.com/JuliaWeb/HTTP.jl/blob/master/src/download.jl
from fileio.jl.
It is practically really not as simple as it might seem for FileIO.jl to handle this with just the URI.
How about a data URI?
https://en.wikipedia.org/wiki/Data_URI_scheme
I'm currently having some trouble because I receive an image from the browser as a data URI, e.g.
"data:image/jpeg;base64,long-base-64-encoded-string"
and I want to load this into Images.jl preferably without saving it to a file.
The Julia type could be something like:
struct DataURI
media
attributes
binary
data
end
I'm kind of stuck on this π
from fileio.jl.
For common image formats we can use magic bytes. And any format that doesn't have magic bytes is devil-spawn π. There are only so many 3-letter combinations out there, I am amazed that people don't always make use of magic bytes.
from fileio.jl.
Related Issues (20)
- The 1.6 update seems to have broken load from URLs for CSVFiles
- Saving output to txt/CSV file? HOT 1
- Proposal: FileIO.save keyword argument syntax (FileIO.kwsave ?) HOT 3
- FIle collision on case sensitive file systems after recent release.
- House AVSfldIO.jl under JulioIO ? HOT 9
- FileIO is not threadsafe HOT 4
- Error in magic function detect_rdata HOT 4
- There was an error in magic function detect_rdata_single HOT 5
- No applicable_loaders found for UNKNOWN HOT 3
- RData can't load .rda files with [email protected] but can with [email protected] HOT 2
- Confusing error when saving the wrong thing
- AstroIO required when it shouldn't be HOT 5
- Too many open files HOT 4
- FileIO not loading / requiring dependency AVSfldIO properly HOT 2
- @maybe macro
- registering zarr files HOT 1
- register Matlab's .mat HOT 1
- Incorrectly export GIF image
- Unhelpful output `#27 (generic function with 1 method)` HOT 2
- [FR] suppert for .webp format 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 fileio.jl.