Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    ishu mishra
    @coderishu
    format
    Ian Gilman
    @iangilman
    @coderishu I don't know if there are any tools that go straight from PDF to DZI, but you can poke around at the options here: https://openseadragon.github.io/examples/creating-zooming-images/
    Otherwise, what you would want to do is convert the PDF to an image and then convert that image to DZI.
    My favorite converter for images to DZI is VIPS, but you can see there are a lot of options.
    That said, you might consider whether you would be better served with a PDF library, and skipping OSD entirely. Perhaps there is a PDF library that supports zooming and overlays?
    Michael J. Dark
    @darkmich_twitter
    If anyone has a minute, can someone tell me what I'm doing wrong here? I swear my zoom in / zoom out controls WERE working, but now they aren't. https://davisthompsonfoundation.org/wsi/?id=518
    Fullscreen works, so I know the controls in general work, but zoom is broken.
    Michael J. Dark
    @darkmich_twitter

    The relevant HTML (for the toolbar and for the OSD initialization) is here:

      <div id="toolbar">
          <div id="logo_div" style="max-height: 50px !important; display: inline-block">
        <a id="logo" href="https://davisthompsonfoundation.org">
        <img class="dtfLogo" src="..." alt="Davis Thompson Logo" style="max-height:50px !important;">
        </a>
         </div>
        <svg id="fullscreen" fill="#fff" style="height: 40px;" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">...</svg></span>
        <svg id="zoomIn" class="w-6 h-6" style="height: 40px;" fill="#FFF" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">...</svg>
        <svg id="zoomOut" class="w-6 h-6" fill="#FFF" style="height: 40px;" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">...</svg>
    
    ...
    </div>
    
    ...
    
    
    <script>
    ...
    
        var viewer = OpenSeadragon({
            id: "openseadragon1",
            prefixUrl: "https://cdnjs.cloudflare.com/ajax/libs/openseadragon/2.4.2/images/",
        navigatorAutoFade:  false,
            showNavigator:  true,
            zoomInButton:   "zoomIn",
          zoomOutButton:  "zoomOut",
          homeButton:     "home",
          fullPageButton: "fullscreen",
            gestureSettingsTouch: {
              pinchRotate: true
          },
            success: function(event) {
              imageDone = true;
            },
        tileSources:  {
                        ...
                      }
    
    });

    (... inserted for portions trimmed out for clarity)

    Michael J. Dark
    @darkmich_twitter
    I've tried setting the SVGs as DIVs, making them <a> links, and nothing seems to work. I also added in an "onclick: console.log('here');" as a way of testing, but I never get the message in the console log. I am well and truly stumped by this one.
    Praful Bhawsar
    @PrafulB
    @darkmich_twitter I’m unable to reproduce your issue, but I tried forcibly adding a zoom call on the zoomIn button click event on your page, and that does make zoom work:
    viewer.zoomInButton.element.addEventListener("click", () => viewer.viewport.zoomBy(2))
    Praful Bhawsar
    @PrafulB
    I’m by no means an OSD expert, so I might be missing something simple, but it feels either like the zoom handlers are not being attached to the buttons during viewer initialization or that they are being overwritten somehow. Wasn’t able to dive too deep in your code, but definitely intriguing.
    Ian Gilman
    @iangilman
    @darkmich_twitter Wow, that's really strange! I have no idea why it would be working for fullscreen, but not zoom in/zoom out. It's clearly working for everything here: https://openseadragon.github.io/examples/ui-binding-custom-buttons/
    My recommendation would be to strip everything down to the bare minimum to try to isolate the issue.
    Though of course, @PrafulB has a fine workaround :D
    If you do figure out what's causing it, we'd love to know!
    Michael J. Dark
    @darkmich_twitter

    @PrafulB - thanks for the workaround! @iangilman - when I get a little more time, I'll work on a stripped-down version. Unfortunately, I'm a pathologist who knows computers some, so my code is... not great... :) And, I swear I had it working before.

    Anyways - thanks to everyone who works on OSD - I've stopped being surprised at how often I see it in various whole-slide imaging implementations (including ours!). It's a great piece of software, and being open-source is great.

    Michael J. Dark
    @darkmich_twitter
    Besides, if you saw the rest of my code, that looks positively elegant. :)
    Ian Gilman
    @iangilman
    @darkmich_twitter Thank you! I'm so glad OSD can power so many cool projects :)
    ... And I'm glad it's easy enough to use for pathologists who know computers some ;)
    em13468
    @Shalahmander

    Hello
    I have small problem.

    Trying to add overlay points to an image that is taller than it is wider. I do this with the help of the command:

    viewer.addOverlay(element, new OpenSeadragon.Point(x, y));

    In case the value of x is greater than 1 - there is no problem. The overlay is simply displayed outside the borders of the image. However, when y is greater than 1, even being inside the image borders, it is displayed as if it had a value of 1. So:

    viewer.addOverlay(element, new OpenSeadragon.Point(0.1, 1.25));

    looks like

    viewer.addOverlay(element, new OpenSeadragon.Point(0.1, 1));

    What could this be due to?

    Ian Gilman
    @iangilman
    @Shalahmander By default, viewport coordinates go from 0 to 1 along the horizontal axis and from 0 to (height / width) along the vertical axis. If your image is taller than it is wide, its height will be larger than 1, so it makes sense that using a y of 1.25 might still have it inside the image.
    em13468
    @Shalahmander
    @iangilman Thank you for your reply! But then I don't understand all the more why, when given the correct value of 1.25, the overlay is displayed as for a value of 1
    Ian Gilman
    @iangilman
    @Shalahmander can you share a screenshot?
    Vanessa Bianconi
    @vanessabianconi
    Hello,
    I have a problem. I am using the plugin that adds SVG overlay capability, to build clickable rectangles on the images but the coordinates to draw the rectangles I have are the image coordinates. How do I convert image coordinates to viewport coordinates manually? I need to do this because I have defined the coordinates of rectangles in an XML file and I extract them from that file.
    4 replies
    larsgw
    @larsgw:matrix.org
    [m]
    Hi, I would like to use OpenSeaDragon to display simple images. Sometimes the images are lower resolution than the viewer, in which case I want the default (and minimum) zoom level to be such that the image is its original size. However, all the zoom level parameters are relative to the viewport. I do have the image dimensions so I could calculate the zoom levels based on that (and the viewer dimensions), but I cannot figure out how to change those when the page is resized. Is there a way to handle this? (If possible, I would also like to avoid relying on the image dimensions, they might not stay available)
    2 replies
    Ramya Janaki
    @sahanaravi
    I have a manifest.json https://api.bl.uk/metadata/iiif/ark:/81055/vdc_00000004216E/manifest.json and I am trying to use OpenSeaDragon to view it, but it gives me error "No TileSource was able to open". Does openSeaDragon work with manifest jsons?
    const source = new TileSource({
    url: imageUrl1
    })
    source && source.addHandler('ready', (event) => {
    const viewer = new Viewer({
    element: imageElementRef.current,
    prefixUrl: '//openseadragon.github.io/openseadragon/images/',
    tileSources: [event.tileSource],
    showRotationControl: false
    })
    })
    Ian Gilman
    @iangilman
    @sahanaravi What happens if you create the viewer first, and just pass it the JSON URL in the tileSources?
    Ramya Janaki
    @sahanaravi
    NO it does not work. I just realized OpenSeaDragon will not work with manifests(compound objets). What is the next best alternative?
    Praful Bhawsar
    @PrafulB
    OpenSeadragon works well with tile sources following the IIIF Image API spec, but I’m unsure if the IIIF Presentation API is supported. Maybe try the Tify IIIF viewer @sahanaravi : https://github.com/tify-iiif-viewer/tify , it claims to support the Presentation API.
    Ramya Janaki
    @sahanaravi
    What about Mirador . https://github.com/tify-iiif-viewer/tify does not seem to be used by that many. Also mine is a react application and Tify seems to be in Vue
    Praful Bhawsar
    @PrafulB
    I’ve only ever used OpenSeadragon, so I’m not very sure about the other libraries. Mirador does not outright claim to support presentation manifests, but it does seem to include them in its tests, so it is likely that it might support them. Hard to say without trying it out though. Another viewer I found that supports your manifest is UniversalVewer : https://uv-v4.netlify.app/#?manifest=https://api.bl.uk/metadata/iiif/ark:/81055/vdc_00000004216E/manifest.json .
    Ramya Janaki
    @sahanaravi
    I dont use typescript, so not able to use UV
    Praful Bhawsar
    @PrafulB
    I don’t think you’ll have to write any TypeScript yourself. As long as you are only loading the viewer as a dependency and not directly modifying its source code yourself, you should be able to interface with it in plain JavaScript, just like you would with OpenSeadragon. The same should go for Tify. If these are dealbreakers though, Mirador might be your best bet.
    Ramya Janaki
    @sahanaravi
    BUt now realized I have react 17 and Mirador is compatible with React 16 . So throws an error Could not resolve dependency:
    npm ERR! peer react@"^16.8.3" from mirador@3.3.0
    Praful Bhawsar
    @PrafulB
    Seems like this is a conflict of peer dependencies. Maybe try unsetting the --legacy-peer-deps flag on npm?
    Ian Gilman
    @iangilman
    I'm in the process of deploying version 4.0.0!
    Ian Gilman
    @iangilman
    Thank you to all the contributors!!
    Ian Gilman
    @iangilman
    OpenSeadragon just got its 100th code contributor! Thank you to everyone who has helped make this tool what it is today! ❤️ https://github.com/openseadragon/openseadragon/graphs/contributors
    Ian Gilman
    @iangilman
    Whoops! I just realized I'm looking at the wrong number… Turns out we actually have 156 contributors already! No matter, the more the merrier… 😄❤️
    Ian Gilman
    @iangilman
    Is it time for OpenSeadragon to drop IE11 support? What do you think? openseadragon/openseadragon#2286