<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" packagePrefix="Fluidbook\Tools\" />
+ <sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/vendor/composer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/brick/math" />
<excludeFolder url="file://$MODULE_DIR$/vendor/nette/schema" />
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/uid" />
<excludeFolder url="file://$MODULE_DIR$/vendor/chillerlan/php-qrcode" />
<excludeFolder url="file://$MODULE_DIR$/vendor/chillerlan/php-settings-container" />
+ <excludeFolder url="file://$MODULE_DIR$/vendor/carbonphp/carbon-doctrine-types" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
use Cubist\Util\CommandLine\Imagemagick;
use Cubist\Util\CommandLine\Poppler;
+use Cubist\Util\Files\Files;
use Cubist\Util\Graphics\PDF;
use Cubist\Util\Text;
use Fluidbook\Tools\Compiler\CompilerInterface;
$cache = $compiler->getCacheDir("zoomarea/" . $cachedir);
+
$leftHeight = min($h, $compiler->getHeightForLinks($attributes['page']) - $y);
$leftWidth = min($w, $compiler->getWidthForLinks($attributes['page']) - $x);
$extractPage,
$leftArea,
null, $extractOptions, $cache);
- if (!file_exists($leftfile)) {
+
+ if (Files::isEmpty($leftfile)) {
throw new \Exception('Failed to generate image with ' . json_encode($attributes));
}
['x' => 0, 'y' => $y, 'width' => $diff, 'height' => $h],
null, $extractOptions, $cache);
- if (!file_exists($rightfile)) {
+ if (Files::isEmpty($rightfile)) {
throw new \Exception('Error generating right part ' . $rightfile);
}
$both = $cache . hash('sha256', $leftfile . $rightfile) . '.' . $ext;
- if (!file_exists($both)) {
+ if (Files::isEmpty($both)) {
if ($ext === 'svg') {
SVGTools::append($leftfile, $rightfile, $both, 'h');
} else {
Imagemagick::append(array($leftfile, $rightfile), $both, 'horizontal');
}
}
- if (!file_exists($both)) {
+ if (Files::isEmpty($both)) {
throw new \Exception('Error glueing ' . $leftfile . ' and ' . $rightfile);
}
} else {
if ($trim) {
$trimmed = str_replace('.jpg', '.trim.' . $ext, $both);
- if (!file_exists($trimmed) || filemtime($trimmed) < filemtime($both)) {
+ if (Files::isEmpty($trimmed) || filemtime($trimmed) < filemtime($both)) {
Imagemagick::trim($both, $trimmed);
}
$both = $trimmed;
// dd($both);
- if (!file_exists($both)) {
+ if (Files::isEmpty($both)) {
Log::error('Failed generate image ' . json_encode($attributes));
}
$dest = 'data/links/' . $save . '_' . $attributes['id'] . '.' . $ext;