These are chat archives for openseadragon/openseadragon

5th
Aug 2015
TravisH84
@TravisH84
Aug 05 2015 08:21 UTC
Hello, I am after some advice on what is the best way to handle my task, I am trying to set up a DB backend to the OpenSeaDragon viewer, so that based on the tile source it loads Overlays from the database, I have a few questions, the first is what is the best way to return the currently loaded tilesource rather actually set it, is that just through openseadragon.tilesource.getImageInfo? secondly, what it the best way to add these overlays to the map, should I build the html page dynamically on page load, or is it more efficient to use addoverlay. One last final question, is there a way I can embed messages into the add-overlay without needing to use Div's and so on, as it would be less messy if I can dynamically build the page using just say mysql and javascript than having to add lots of Divs for many points?
Sorry for such a simple question, but also I have a test page set up at http://www.travishale.com/panoramas/test/, for the backend I want to use some of this to work out the X and Y parameters I actually need for the overlays, is it the Physical Mouse X and Y, or another parameter which is supposed to represent what I enter in the overlay paramers, or should I use something like PhysicalToDataX 7 Y?
TravisH84
@TravisH84
Aug 05 2015 12:41 UTC
I got the coordinates bit worked out, just not sure how to most efficiency add overlays, which I would use to show more information about specific points (e.g. popups) however given there are so many points I may display depending on the source, that I am wondering if there is a more efficient way than using divs and handling clicks on overlays to trigger popups.
Ian Gilman
@iangilman
Aug 05 2015 16:04 UTC
@TravisH84 Howdy! Do you want your overlays all visible at the same time? Do you want the text to grow and shrink with the zooming?
...which adds an SVG layer that zooms and pans with the image
If you don't use that but instead go with the built-in overlays, it all comes down to divs regardless of if you make the overlay or have OSD make it.
VoidVolker
@VoidVolker
Aug 05 2015 18:13 UTC
I'm pleased to announce MagickSlicer - simple bash script to slice any image to tiles (DZI basic or custom), works in linux (tested in ubuntu) and OSX. Need only imagemagick installed. Pullrequests are welcome )
Also, welcome to chat
DanGart
@DanGart
Aug 05 2015 18:15 UTC
@VoidVolker god, lord. Where were you this morning? I have been solving this problem for several hours :) anyway, thanks!:)
VoidVolker
@VoidVolker
Aug 05 2015 18:18 UTC
@DanGart try it )
if you find some errors or have new idea - please, msg me here or create issue in github
DanGart
@DanGart
Aug 05 2015 18:27 UTC
Ok. No problem. Btw, do u have documentation for this script? Just looked throught it, it seems pretty big for me
Ian Gilman
@iangilman
Aug 05 2015 18:31 UTC
@VoidVolker might be good to have a couple example usages at the top (in addition to the usage map), like "if you want to do DZI, try ./magick-slicer foo.jpg -d".
@DanGart ^ that's the DZI formula
Antoine Vandecreme
@avandecreme
Aug 05 2015 18:46 UTC
@VoidVolker I tried your script. The levels start at 1 (instead of 0). Is it still compatible with OSD? (I would expect seeing only the top left of the image in OSD)
VoidVolker
@VoidVolker
Aug 05 2015 18:47 UTC
1? must start from 0
Ian Gilman
@iangilman
Aug 05 2015 18:47 UTC
No, it needs to start from 0
VoidVolker
@VoidVolker
Aug 05 2015 18:47 UTC
one moment, i'll check
Ian Gilman
@iangilman
Aug 05 2015 18:47 UTC
Sounds like we have our first bug! :)
VoidVolker
@VoidVolker
Aug 05 2015 18:48 UTC
looks like i forget about 0 )
Antoine Vandecreme
@avandecreme
Aug 05 2015 18:51 UTC
OSD is actually doing surprising things when starting at 1
it mostly works :p
Ian Gilman
@iangilman
Aug 05 2015 18:51 UTC
Sounds amusing ;)
VoidVolker
@VoidVolker
Aug 05 2015 19:00 UTC
fixed
all what you need is just ./magick-slicer.sh foo.jpg
Ian Gilman
@iangilman
Aug 05 2015 19:05 UTC
That produces DZI by default?
VoidVolker
@VoidVolker
Aug 05 2015 19:07 UTC
yes
dzi is default
Ian Gilman
@iangilman
Aug 05 2015 19:07 UTC
Cool :)
Antoine Vandecreme
@avandecreme
Aug 05 2015 19:28 UTC
@VoidVolker There is an issue to generate the dzi for this file https://cloud.githubusercontent.com/assets/1725653/9010765/3d6ab260-37a9-11e5-906e-c3461bcf3b5d.jpg
VoidVolker
@VoidVolker
Aug 05 2015 19:29 UTC
@avandecreme what issue?
Antoine Vandecreme
@avandecreme
Aug 05 2015 19:29 UTC
(Don't ask who these guys are, I just took it from there openseadragon/openseadragon#695 :p )
pyamid.png
VoidVolker
@VoidVolker
Aug 05 2015 19:32 UTC
Oo
may be this is your local bug?
VoidVolker
@VoidVolker
Aug 05 2015 19:37 UTC
what command you used?
by stabdard, DZI must be square, but I don't care and make support for any size - and OSD is support it )
can you share your code, please?
VoidVolker
@VoidVolker
Aug 05 2015 19:45 UTC
@avandecreme ?
Antoine Vandecreme
@avandecreme
Aug 05 2015 20:03 UTC
sorry, here is the command I ran: ./magick-slicer.sh 3d6ab260-37a9-11e5-906e-c3461bcf3b5d.jpg -e png
^ @VoidVolker
VoidVolker
@VoidVolker
Aug 05 2015 20:13 UTC
please, check the tiles
I don't have this
Antoine Vandecreme
@avandecreme
Aug 05 2015 20:22 UTC
OSD seems to expect a level 13 but imageslicer only generates up to level 12
When generating with my own tool, I still have 1 image at level 8
with magickslicer, I have 2 images at level 8
VoidVolker
@VoidVolker
Aug 05 2015 20:33 UTC
level 0 = 1x1 px, level 7 = 256x256, 8 = 512
Antoine Vandecreme
@avandecreme
Aug 05 2015 20:35 UTC
No that doesn't work this way.
    int maxDim = Math.max(originalWidth, originalHeight);
    int nLevels = (int) Math.ceil(Math.log(maxDim) / Math.log(2));
Ian Gilman
@iangilman
Aug 05 2015 20:47 UTC
@VoidVolker yes, sorry if I wasn't more clear on that...level 7 isn't necessarily 256...it's just whatever you get to by cutting the original size in half successively
@avandecreme are you using the same tile size in MagickSlicer as you did for the other version you made? That would affect how the levels break down
Antoine Vandecreme
@avandecreme
Aug 05 2015 20:48 UTC
yes
Ian Gilman
@iangilman
Aug 05 2015 20:48 UTC
Cool
@avandecreme thanks for finding these issues!
TravisH84
@TravisH84
Aug 05 2015 23:46 UTC
@iangilman , thanks for the tips. I am happy for the overlays or points to be shown all on the one image they relate to, but it does look like I will need to use the div's by the look of it. Just a feature request more than anything but it would be nice in future versions if you could potentially have an overlay or point that you can associate text with inside the point, rather than using div's (say through the userobject) so when the point is clicked it provides the userobject data for rendering or whatever. Another question, how do I programatically determine the source of the currently loaded tile?