Skip to content
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

Reading file from the network? Example code. #103

Closed
spelufo opened this issue Apr 21, 2023 · 2 comments · Fixed by #112
Closed

Reading file from the network? Example code. #103

spelufo opened this issue Apr 21, 2023 · 2 comments · Fixed by #112

Comments

@spelufo
Copy link
Contributor

spelufo commented Apr 21, 2023

Hi, I wanted to load an image from an HTTP server without saving it to disk and came up with this snippet. I don't know if this is a supported usage or if it is wrong in some way / has some downside. I sort of matched the type signatures until I found a combination that worked. If it is good, maybe it could be added to the examples.

function load_tiff_without_saving(url)
  buffer = IOBuffer()
  Downloads.download(url, buffer)
  bufstream = TiffImages.getstream(format"TIFF", buffer)
  TiffImages.load(read(bufstream, TiffFile))
end
@tlnagy
Copy link
Owner

tlnagy commented May 10, 2023

Yeah, I think it might be nice to have small examples of common patterns in the docs. Might be nice to add a another Literate doc under "Examples" called "Common Patterns" and have small little vignettes under that?

Could be a good usage of https://github.com/JuliaDocs/DemoCards.jl to handle such small vignettes.

tlnagy added a commit that referenced this issue Sep 21, 2023
closes #103

Co-Authored-By: Santiago Pelufo <[email protected]>
@tlnagy
Copy link
Owner

tlnagy commented Sep 21, 2023

Thanks @spelufo! I added your code to a small demo in #112.

tlnagy added a commit that referenced this issue Sep 21, 2023
closes #103

Co-Authored-By: Santiago Pelufo <[email protected]>
tlnagy added a commit that referenced this issue Sep 21, 2023
closes #103

Co-Authored-By: Santiago Pelufo <[email protected]>
tlnagy added a commit that referenced this issue Sep 22, 2023
closes #103

Co-Authored-By: Santiago Pelufo <[email protected]>
tlnagy added a commit that referenced this issue Sep 22, 2023
closes #103

Co-authored-by: Santiago Pelufo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants