-
Notifications
You must be signed in to change notification settings - Fork 80
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
Support URLs #89
Comments
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 |
https://github.com/JuliaWeb/URIParser.jl would be the standard for that. |
Thanks, folks---great tips. |
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? |
Eventually someone pointed me out to the "secret" |
It is practically really not as simple as it might seem for FileIO.jl to handle this with just the URI. And getting the filename (and thus extension) is more complex than one might think. |
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.
and I want to load this into Images.jl preferably without saving it to a file. The Julia type could be something like:
I'm kind of stuck on this 😔 |
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. |
Right now you can't supply a URL for a filename; you have to
download
and thenload
. What do people think about having that be more transparent?If folks like that: since I'm pretty net-naive, what would be the best thing to search for? Should we require that the string begins with
"http://"
or"https://"
?CC @alanedelman
The text was updated successfully, but these errors were encountered: