Serve dzi from S3 storage
See original GitHub issueHi,
I’m trying to serve dzi file stored in s3 storage and getting errors below.
s3 storage
s3://s3-storage/hyper-resolution-image/sample.dzi s3://s3-storage/hyper-resolution-image/sample_files/{level}/{x}_{y}.jpeg
sample.dzi
<?xml version="1.0" encoding="UTF-8"?>
<Image xmlns="http://schemas.microsoft.com/deepzoom/2008"
Format="jpeg"
Overlap="1"
TileSize="254"
>
<Size
Height="42669"
Width="58073"
/>
</Image>
get signed url from s3 storage
function s3_bucket_url_js (key: string) {
let url = s3.getSignedUrl('getObject', {
Bucket: "s3-storage",
Expires: 60*30,
Key: key,
}, function (err, url) {
if(err) {
console.log(err)
} else {
console.log(url)
}
})
return url
}
initialize openseadragon viewer
let viewer : OpenSeadragon = OpenSeadragon({
id: "viewer",
prefixUrl: "//openseadragon.github.io/openseadragon/images/",
tileSources: {
height: 42669,
width: 58073,
tileSize: 254,
overLap: 1,
getTileUrl: function (level : Number, x : Number, y : Number) {
let url_s = "hyper-resolution-image/sample_files/" + level + "/" + x + "_" + y + ".jpeg"
return s3_bucket_url_js(url_s)
},
}
})
I’m getting two errors like below.
- tile.js:136 Tile constructor needs ‘cacheKey’ variable: creation tile cache in Tile class is deprecated. TileSource.prototype.getTileHashKey will be used. (tile.js:136)
- Assertion failed: [TileCache.getImageRecord] cacheKey is required (tilecache.js:237)
have any idea about this error or how to serve dzi from s3 storage?
Thank you.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Openseadragon Zoomify tile source with AWS S3 presigned ...
I reference the .dzi file as a tilesource. To use it this way, I had to make the permissions 'public'. S3 warns against...
Read more >Access deep zoom images stored on AWS S3 from JS
We are trying to serve large deep zoom images from our private S3 bucket and view them in a browser with an appropriate...
Read more >Crop images at max resolution from DZI pyramid
Hello, I currently use vips to crop regions from .SVS files based on the x, y. width and height. vips crop slide.svs crop.jpeg...
Read more >Serverless Architecture for a Web Scraping Solution - AWS
We have at least two options to consider: on-premises (such as on your local machine, a Raspberry Pi server at home, a virtual...
Read more >full-res pan-and-zoom JS viewer on a sufia/hyrax app
They are stored (for better or worse) as TIFFs with no ... fairly expensive server resources to handle heavy load; the pre-generated DZI...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I serve up all my deep zoom images via S3. I have all folders and .dzi files in a publicly accessible bucket. Also requires setting cross-origin resource sharing (CORS) for my domain(s).
Best practice? Certainly not, but have not had any issues in over 8 years. The cost is miniscule.
You can view the source on many pages of my site: https://chattanoogahistory.com
Example:
@FrostScent we want to solve it nevertheless, since it might be an inconsistent/ faulty behaviour. I can see you are afraid of debugging - in JavaScript this is easy and fast, much faster than writing this post here. If you open the browser inspector window (f12) find in sources tab the tileSource.js file, set a breakpoint on the method we discuss and run it you see what goes wrong immediately. ~20 seconds.
Btw. learning how to do this will save you a lots of time in the future.