Trying to setup OpenSeadragon for a WordPress site. Just testing around now and trying to get the zoom feature to work.
- I've included the OpenSeadragon scripts in order to view the DZI images. I tink I'm good there.
- My issue is actually generating a DZI image from a hi-res image. How do I do this and can it be done on the fly?
I've tried including the DeepZoom tile generator without success and continue getting a "Fatal error: Uncaught Error: Class 'League\Flysystem\Filesystem' not found" error.
The only other DZI generator I see that might work is a Windows desktop app which won't work, I'm on a mac.
This is what I have so far (just working of examples provided by openseadragon and deepzoom):
I'm including Deepzoom.php and DeepzoomFactory.php in my functions file.
<div id="primary" class="content-area zoom">
<main id="main" class="site-main">
<?php
// Setup Deepzoom
$deepzoom = Jeremytubbs\Deepzoom\DeepzoomFactory::create([
'path' => '/wp-content/uploads/DZI/ready/', // Export path for tiles
'driver' => 'imagick', // Choose between gd and imagick support.
'format' => 'jpg',
]);
// folder, file are optional and will default to filename
$response = $deepzoom->makeTiles('/wp-content/uploads/DZI/oklahoma.jpg');
?>
<div id="openseadragon1" style="width: 800px; height: 600px;"></div>
<script src="<?php echo get_template_directory_uri() ; ?>/lib/openseadragon/openseadragon.min.js"></script>
<script type="text/javascript">
var viewer = OpenSeadragon({
id: "openseadragon1",
prefixUrl: "/wp-content/themes/truelook/lib/openseadragon/images/",
tileSources: <?php echo $response; ?>
});
</script>
Any suggestions or advice pointing me in the right directio would be most welcome. Thanks!