hherold/deepzoom

Fork of Deepzoom tile generator with additional watermark support

0.1.0 2021-06-14 12:42 UTC

This package is auto-updated.

Last update: 2024-05-14 19:26:48 UTC


README

This is a modified fork of jeremytubbs/deepzoom, a tile Generator for use with OpenSeadragon.
It supports automatic watermark insertion.

Basic watermark support

To automatically add a watermark image to tiles, we use the insert() method of the Intervention Image library.
Users can specify the image-file and the zoom-level from which on the watermark should be applied.
This alpha version was tested with imagick image library only.

Example implementation

   require_once __DIR__ . '/vendor/autoload.php';

   $options = [
      'path'           => 'tiles',
      'format'         => 'jpg',
      'watermarkFile'  => 'watermark.png',
      'watermarkLevel' => 10,
   ];
   $source = 'images/test.jpg';
   $folder = null;
   $file = null;

   // Setup Deepzoom
   $deepzoom = Hherold\Deepzoom\DeepzoomFactory::create($options);

   // folder, file are optional and will default to filename
   $response = $deepzoom->makeTiles($source, $folder, $file);

path
The export path for tiles.
required

format
The export format for tiles. Watermark support was only tested with jpg files.
Default: jpg

watermarkFile
If you want the module to automatically add a watermark to the tiles, specify the file here. Transparent PNG works best.
Default: null

watermarkLevel
Specify from which zoom-level on the watermark should be applied.
Default: 10

Supported Image Libraries

Originally Deepzoom supports Imagick and gd. This module however is only tested with Imagick (>=6.5.7), which is therefore set default.

FYI:

Filenames for JSONP must not start with a number and should not contain hyphen therefore filename spaces and hyphens will be converted to underscores. Folder name spaces will be converted to hyphens. If you would like to avoid this auto-naming declare your 'folder' and 'file' within the maketiles method.

License

MIT