From 66f67e6466a77e256afe8ece813cd4a85d590537 Mon Sep 17 00:00:00 2001 From: Max T Date: Mon, 7 Oct 2024 12:56:24 +0200 Subject: [PATCH] add vips functions for testing colour-space conversion --- src/Jobs/TileSingleOverlay.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/Jobs/TileSingleOverlay.php b/src/Jobs/TileSingleOverlay.php index fffc813..27bc06e 100644 --- a/src/Jobs/TileSingleOverlay.php +++ b/src/Jobs/TileSingleOverlay.php @@ -7,6 +7,7 @@ use FileCache; use Biigle\Modules\Geo\GeoOverlay; use File; +use Jcupitt\Vips; class TileSingleOverlay extends TileSingleObject { @@ -55,4 +56,23 @@ public function handle() File::deleteDirectory($this->tempPath); } } + + /** + * Generate tiles for the object and put them to temporary storage. + * + * @param File $file + * @param string $path Path to the cached image file. + */ + public function generateTiles($file, $path) + { + $vipsImage = $this->getVipsImage($path); + $sourceSpace = Vips\FFI::vips()->vips_image_guess_interpretation($vipsImage); + // dd($sourceSpace); + + $vipsImage->colourspace(Vips\Interpretation::RGB16)->dzsave($this->tempPath, [ + 'layout' => 'zoomify', + 'container' => 'fs', + 'strip' => true, + ]); + } }