$this->compiler->copyLinkFile($file, 'data/links/', $video);
}
- public function copyExternalDir($dir) {
- $this->compiler->copyLinkDir($dir, 'data/links');
+ public function copyExternalDir($dir, $dest = 'data/links') {
+ $this->compiler->copyLinkDir($dir, $dest);
}
public function unzipFile($file, $moveAssets = false) {
$h = round($this->height * $this->getCssScale());
// Note: width and height for the video is normally measured from the
- // preview frame for local files or set to 1280 x 720 for web videos.
- // The $w and $h variables here seem to be null generally...
+ // preview frame for local files or set to 1280 x 720 for web videos.
+ // The $w and $h variables here seem to be null generally...
return $this->makeVideoTag($this, $w, $h, $this->compiler);
}
$attr['height'] = $h;
} else if (!is_null($compiler)) {
- // Get video dimensions from thumbnail if possible (locally uploaded files)
+ // Get video dimensions from thumbnail if possible (locally uploaded files)
$path = WS_BOOKS . '/working/' . $compiler->book_id . '/' . $basename . '.jpg';
$dim = getimagesize($path);
$attr['width'] = $dim[0];
if ($ext == 'oam') {
$d = $this->unzipFile($this->alternative, true);
$this->_config = $this->getConfigOAM($d['dir']);
- $this->copyExternalDir($d['dir']);
+ $this->copyExternalDir($d['dir'], $d['fdir']);
} elseif ($ext == 'zip') {
$d = $this->unzipFile($this->alternative, false);
$this->_config = $this->getConfigZIP($d['dir']);
- $this->copyExternalDir($d['dir']);
+ $this->copyExternalDir($d['dir'], $d['fdir']);
} elseif ($ext == 'html') {
$fdir = 'data/links';
$dir = $fdir;
// Data attributes
$attributes = [
'maxzoom' => $this->to,
- 'width' => round($this->width),
- 'height' => round($this->height)
+ 'width' => round($this->width),
+ 'height' => round($this->height)
];
// Set data attributes
$maxzoom = ((int)$this->to !== 0) ? $this->to : 2; // Max zoom level might not always be set in the link editor
- // TODO: Consider generating higher-res images (eg. 2x) for HiDPI screens. Maybe some extra optimisations can be done on the larger images...
+ // TODO: Consider generating higher-res images (eg. 2x) for HiDPI screens. Maybe some extra optimisations can be done on the larger images...
$extractOptions = [
- // The Poppler::extractArea function accepts a resolution setting and uses that to determine the
- // scale factor on the extracted images. It does so by dividing by 72, so we can pass our own scale
- // factor by setting the resolution to 72 * $maxzoom
- 'resolution' => 72 * $maxzoom
- ];
+ // The Poppler::extractArea function accepts a resolution setting and uses that to determine the
+ // scale factor on the extracted images. It does so by dividing by 72, so we can pass our own scale
+ // factor by setting the resolution to 72 * $maxzoom
+ 'resolution' => 72 * $maxzoom
+ ];
// Round all link co-ordinates because there seems to be a problem with the the Workshop link editor
- // where link "left" values (and maybe others) change fractionally upon saves. This causes problems later when
- // extracting the zoom images from the PDF because it causes a cache-miss and the images are regenerated again.
+ // where link "left" values (and maybe others) change fractionally upon saves. This causes problems later when
+ // extracting the zoom images from the PDF because it causes a cache-miss and the images are regenerated again.
$x = round($this->left);
$y = round($this->top);
$w = round($this->width);
$h = round($this->height);
- $bookwidth = round($this->compiler->book->parametres->width);
+ $bookwidth = round($this->compiler->book->parametres->width);
- //error_log("--- Book Width: $bookwidth ---");
+ //error_log("--- Book Width: $bookwidth ---");
$p = wsDAOBook::getDocumentPage($this->compiler->book_id, $this->page);
$pdfpath = wsDocument::getDir($p['document_id']) . 'original.pdf';
- $left = CubeIT_Files::tempnam();
+ $left = CubeIT_Files::tempnam();
$leftfile = CubeIT_CommandLine_Poppler::extractArea($pdfpath,
$p['document_page'],
array('x' => $x, 'y' => $y, 'width' => $w, 'height' => $h),