Skip to content

Commit

Permalink
Fixed use of tiles (bug introduced in #020e0568).
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-KM committed Feb 17, 2019
1 parent 1c5fdde commit d4e0512
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion controllers/ImageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ protected function _usePreTiled($file, $transform)
$tileInfo = $helper->tileInfo($file);
if ($tileInfo) {
$helper = new UniversalViewer_Controller_Action_Helper_TileServer();
$tile = $this->tileServer($tileInfo, $transform);
$tile = $helper->tileServer($tileInfo, $transform);
return $tile;
}
}
Expand Down
13 changes: 12 additions & 1 deletion libraries/UniversalViewer/Controller/Action/Helper/TileInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,21 @@ public function tileInfo(File $file)
$url = get_option('openlayerszoom_tiles_web') ?: WEB_FILES . '/zoom_tiles';
$this->tileBaseUrl = $url;

$tilingData = $this->getTilingData($file->filename);
$tilingData = $this->getTilingData($this->baseFilename($file->filename));
return $tilingData;
}

/**
* Get a filepath without extension, i.e. "/path/file.ext" to "/path/file".
*
* @return string
*/
protected function baseFilename($filepath)
{
$extension = pathinfo($filepath, PATHINFO_EXTENSION);
return strlen($extension) ? substr($filepath, 0, strrpos($filepath, '.')) : $filepath;
}

/**
* Check if an image is zoomed and return its main data.
*
Expand Down

0 comments on commit d4e0512

Please sign in to comment.