$fluidbook = FluidbookPublication::withoutGlobalScopes()->find($id);
$files = [
// Thumbnail
- ['jpg', 'thumb', true, true, ''],
+ ['jpg', 'thumb', true, true, false, ''],
// Images
- ['jpg', 150, false, true, 'html'],
+ ['jpg', 150, false, true, false, 'html'],
// Texts
- ['svg', 150, true, false, 'html'],
+ ['svg', 150, true, false, false, 'html'],
];
foreach ($files as $file) {
- $fluidbook->getFile($this->argument('page'), $file[0], $file[1], $file[2], $file[3], $file[4], true);
+ $fluidbook->getFile($this->argument('page'), $file[0], $file[1], $file[2], $file[3], $file[4], $file[5], true);
}
}
}
if ($thisimagesvg) {
$source = $this->getFluidbook()->getFile($page, 'svg', 150, true,
- in_array($page, $this->config->vectorPages), 'html');
+ in_array($page, $this->config->vectorPages),false, 'html');
$filesToCopy[$source] = 'data/contents/p' . $page . '.svg';
}
{
/** @var FluidbookDocument $doc */
$doc = FluidbookDocument::withoutGlobalScopes()->find($doc_id);
- $path = $doc->getFile($doc_page, 'jpg', 'thumb', true, true, '');
+ $path = $doc->getFile($doc_page, 'jpg', 'thumb', 85, true, true, false, '');
if (filesize($path) === 0) {
for ($i = 1; $i <= 8; $i++) {
clearstatcache();
{
/** @var FluidbookPublication $publication */
$publication = FluidbookPublication::withoutGlobalScopes()->find($fluidbook);
- $path = $publication->getFile($page, 'jpg', 150, true, true, '');
+ $path = $publication->getFile($page, 'jpg', 150, true, true, false, '');
return XSendFileController::sendfile($path);
}
}
protected $version;
protected $forceCheck;
protected $forceProcess;
+ protected $transparent;
protected $path = "";
protected $log = '';
- public function __construct($document, $page, $format = 'jpg', $resolution = 150, $quality = 85, $withText = true, $withGraphics = true, $version = 'html', $forceCheck = false, $forceProcess = false)
+ public function __construct($document, $page, $format = 'jpg', $resolution = 150, $quality = 85, $withText = true, $withGraphics = true, $transparent = false, $version = 'html', $forceCheck = false, $forceProcess = false)
{
$this->onQueue('fluidbookprocess');
$this->document = $document;
$this->quality = $quality;
$this->withGraphics = $withGraphics;
$this->withText = $withText;
+ $this->transparent = $transparent;
$this->version = $version;
$this->forceCheck = $forceCheck || $forceProcess;
$this->forceProcess = $forceProcess;
- $this->path = $this->document->_getPath($this->page, $this->format, $this->resolution, $this->quality, $this->withText, $this->withGraphics, $this->version);
+ $this->path = $this->document->_getPath($this->page, $this->format, $this->resolution, $this->quality, $this->withText, $this->withGraphics, $this->transparent, $this->version);
}
public function handle()
{
try {
- echo $this->document->getFile($this->page, $this->format, $this->resolution, $this->quality, $this->withText, $this->withGraphics, $this->version, $this->forceCheck, $this->forceProcess) . "\n";
+ echo $this->document->getFile($this->page, $this->format, $this->resolution, $this->quality, $this->withText, $this->withGraphics, $this->transparent, $this->version, $this->forceCheck, $this->forceProcess) . "\n";
} catch (\Exception $e) {
Log::warning($e->getMessage());
$this->log = $e->getMessage();
public function isOK($forceCheck = false)
{
- return $this->document->hasFile($this->page, $this->format, $this->resolution, $this->quality, $this->withText, $this->withGraphics, $this->version, $this->forceCheck || $forceCheck);
+ return $this->document->hasFile($this->page, $this->format, $this->resolution, $this->quality, $this->withText, $this->withGraphics, $this->version, $this->transparent, $this->forceCheck || $forceCheck);
}
public function isError()
$resolutions = Compiler::getBookResolutions($this->book);
$rasterizePages = ArrayUtil::parseRange($settings->rasterizePages);
$vectorPages = array_diff(ArrayUtil::parseRange($settings->vectorPages), $rasterizePages);
+ $transparent = $this->book->getAttribute('transparentPage', false);
switch ($settings->mobileVersion) {
case 'html5-desktop':
$pageBackgroundsToGenerate = $thisrasterize ? [true] : $globalBackgroundToGenerate;
foreach ($resolutions as $r) {
foreach ($pageBackgroundsToGenerate as $withText) {
- $this->getFile($page, $settings->imageFormat, $r, $withText, true, $imdir);
+ $this->getFile($page, $settings->imageFormat, $r, $withText, true, $transparent, $imdir);
}
}
if ($thisimagesvg) {
- $this->getFile($page, 'svg', 150, true, in_array($page, $vectorPages), 'html');
+ $this->getFile($page, 'svg', 150, true, in_array($page, $vectorPages), false, 'html');
}
$this->getFile($page, $settings->imageFormat, 'thumb');
}
return $missing <= 0;
}
- protected function getFile($page, $format = 'jpg', $resolution = 150, $withText = true, $withGraphics = true, $version = 'html')
+ protected function getFile($page, $format = 'jpg', $resolution = 150, $withText = true, $withGraphics = true, $transparent = false, $version = 'html')
{
$c = $this->book->getComposition()[$page];
$doc = $this->book->getDocument($page);
$quality = $this->book->JPEGQuality ?: 85;
- $job = new FluidbookDocumentFileProcess($doc, $c[1], $format, $resolution, $quality, $withText, $withGraphics, $version);
+ $job = new FluidbookDocumentFileProcess($doc, $c[1], $format, $resolution, $quality, $withText, $withGraphics, $transparent, $version);
$this->jobs[] = $job;
if ($job->isDone()) {
return;