-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
closes #103 Co-Authored-By: Santiago Pelufo <[email protected]>
- Loading branch information
Showing
3 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# --- | ||
# title: Loading a remote TIFF | ||
# description: This demo shows how to load a TIFF over the network | ||
# author: Santiago Pelufo, Tamas Nagy | ||
# cover: assets/coffee.png | ||
# --- | ||
|
||
# The following code can be used to load remote TIFFs without saving them to the | ||
# disk. | ||
|
||
using TiffImages, Downloads, FileIO | ||
|
||
function load_tiff_without_saving(url) | ||
buffer = IOBuffer() | ||
Downloads.download(url, buffer) | ||
bufstream = TiffImages.getstream(format"TIFF", buffer) | ||
TiffImages.load(read(bufstream, TiffFile)) | ||
end | ||
|
||
# We'll load an example from | ||
# [`tlnagy/exampletiffs`](https://github.com/tlnagy/exampletiffs) | ||
|
||
coffeepath = "https://github.com/tlnagy/exampletiffs/raw/11516d288c4b03a258aa3027705b0e9d2ce2b5de/coffee.tif" | ||
coffeeimg = load_tiff_without_saving(coffeepath) | ||
|
||
# No disks involved! | ||
|
||
save("assets/coffee.png", coffeeimg) #src |