<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
- <component name="PublishConfigData" autoUpload="Always" serverName="dev.toolbox.fluidbook.com" remoteFilesAllowedToDisappearOnAutoupload="false" confirmBeforeUploading="false" autoUploadExternalChanges="true" showAutoUploadSettingsWarning="false">
+ <component name="PublishConfigData" autoUpload="Always" serverName="toolbox.fluidbook.com" remoteFilesAllowedToDisappearOnAutoupload="false" confirmBeforeUploading="false" autoUploadExternalChanges="true" showAutoUploadSettingsWarning="false">
<option name="confirmBeforeUploading" value="false" />
<serverData>
<paths name="alphaville.cubedesigners.com">
}
public function getImageUrl() {
- return 'data/links/layer_' . $this->uid . '.jpg';
+ return 'data/links/layer_' . $this->uid . '.' . $this->_getExtension();
+ }
+
+ protected function _getExtension() {
+ if ($this->_getLayer() === 'text') {
+ return 'svg';
+ } else {
+ return 'jpg';
+ }
+ }
+
+ protected function _getLayer() {
+ return $this->to ?: 'both';
}
public function getZoomAttributes() {
- $layer = $this->to ?: 'both';
+ $layer = $this->_getLayer();
return [
'id' => $this->uid,
'page' => $this->page,
unset($attributes['layer']);
}
+ $bookwidth = $compiler->getWidthForLinks();
$x = $attributes['x'];
$y = $attributes['y'];
$w = $attributes['width'];
$h = $attributes['height'];
- $bookwidth = $compiler->getWidthForLinks();
+
+ if ($attributes['page'] == 0) {
+ $diff = $bookwidth - $attributes['x'];
+ $attributes['page'] = 1;
+ $x = 0;
+ $w -= $diff;
+ }
if (!isset($attributes['pdf']) || !$attributes['pdf']) {
$pdfpath = $compiler->getPagePDFSource($attributes['page']);
$extractPage = $attributes['page'];
}
- if (isset($attributes['layer']) && $attributes['layer'] === 'image') {
- $extractOptions['texts'] = false;
+ $extractOptions['format'] = 'jpeg';
+ $ext = 'jpg';
+ if (isset($attributes['layer'])) {
+ if ($attributes['layer'] === 'image') {
+ $extractOptions['texts'] = false;
+ $extractOptions['background'] = true;
+ } else if ($attributes['layer'] === 'text') {
+ $extractOptions['texts'] = true;
+ $extractOptions['background'] = false;
+ $ext = $extractOptions['format'] = 'svg';
+ }
}
$cache = $compiler->getCacheDir("zoomarea/" . $cachedir);
throw new \Exception('Error generating right part ' . $rightfile);
}
- $both = $cache . hash('sha256', $leftfile . $rightfile) . '.jpg';
+ $both = $cache . hash('sha256', $leftfile . $rightfile) . '.' . $ext;
if (!file_exists($both)) {
Imagemagick::append(array($leftfile, $rightfile), $both, 'horizontal');
}
}
if ($trim) {
- $trimmed = str_replace('.jpg', '.trim.jpg', $both);
+ $trimmed = str_replace('.jpg', '.trim.' . $ext, $both);
if (!file_exists($trimmed) || filemtime($trimmed) < filemtime($both)) {
Imagemagick::trim($both, $trimmed);
}
// dd($both);
- $dest = 'data/links/' . $save . '_' . $attributes['id'] . '.jpg';
+ $dest = 'data/links/' . $save . '_' . $attributes['id'] . '.' . $ext;
$compiler->simpleCopyLinkFile($both, $dest);
}