From: Vincent Vanwaelscappel Date: Wed, 31 Aug 2022 10:51:39 +0000 (+0200) Subject: wait #5408 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=e08a88762b6c793050dc4bcb2a10dcf6048c049c;p=fluidbook-toolbox.git wait #5408 @1 --- diff --git a/.docker/images/php/Dockerfile b/.docker/images/php/Dockerfile index 11ff1229a..9aff1f6c5 100644 --- a/.docker/images/php/Dockerfile +++ b/.docker/images/php/Dockerfile @@ -75,7 +75,7 @@ RUN apt-get -y --no-install-recommends install nodejs google-chrome-stable RUN apt-get -y --no-install-recommends install sudo RUN apt-get -y --no-install-recommends install supervisor ssh rsync RUN apt-get -y --no-install-recommends install nsis -RUN apt-get -y --no-install-recommends install default-jre pdftk poppler-utils ghostscript imagemagick netpbm libjpeg-turbo8 +RUN apt-get -y --no-install-recommends install default-jre pdftk poppler-utils ghostscript imagemagick netpbm libjpeg-turbo8 libjpeg-turbo-progs RUN apt-get -y --no-install-recommends install zip unzip gzip 7zip RUN apt-get -y --no-install-recommends install icoutils fontforge RUN apt-get -y --no-install-recommends install ffmpeg python3 lame diff --git a/.gitignore b/.gitignore index a82927384..665cbf572 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ /public/hot /public/storage /storage/*.key +/storage/fluidbook /vendor /.env /.env.backup diff --git a/app/Jobs/FluidbookCompiler.php b/app/Jobs/FluidbookCompiler.php index 864d06616..bbc3e3f0f 100644 --- a/app/Jobs/FluidbookCompiler.php +++ b/app/Jobs/FluidbookCompiler.php @@ -1973,7 +1973,7 @@ height="0" width="0" style="display:none;visibility:hidden"> protected function writeScorm() { $manifestfiles = ['1.2' => '_imsmanifest.12.xml', '2004' => '_imsmanifest.2004.xml', '2004.3' => '_imsmanifest.2004-3.xml']; - $manifestfile = $manifestfiles[$this->fluidbookSettings->scorm_version]; + $manifestfile = $manifestfiles[(string)$this->fluidbookSettings->scorm_version]; $manifest = file_get_contents($this->assets . '/' . $manifestfile); if (!$this->fluidbookSettings->scorm_title) { @@ -3991,6 +3991,11 @@ height="0" width="0" style="display:none;visibility:hidden"> public function page_path($page, $path = ''): string { - // TODO: Implement page_path() method. + return ''; + } + + public function getPagePDFSource($page): string + { + return $this->getFluidbook()->getPDFSplitSource($page); } } diff --git a/app/Models/FluidbookPublication.php b/app/Models/FluidbookPublication.php index 40d42edd3..bef94b151 100644 --- a/app/Models/FluidbookPublication.php +++ b/app/Models/FluidbookPublication.php @@ -195,6 +195,17 @@ class FluidbookPublication extends ToolboxSettingsModel return self::_getDocument($compo[0])->getHightlightFile($compo[1]); } + public function getPDFSplitSource($page) + { + $compo = $this->composition[$page]; + $doc = self::_getDocument($compo[0]); + $pdf = $doc->path('pdf/p' . $compo[1] . '.pdf'); + if (!file_exists($pdf)) { + $doc->splitPDF(); + } + return $pdf; + } + public function getFile($page, $format = 'jpg', $resolution = 150, $withText = true, $withGraphics = true, $version = 'html', $force = false) { @@ -298,9 +309,12 @@ class FluidbookPublication extends ToolboxSettingsModel public function getPDFSource($page, $type = 'crop'): string { $compo = $this->composition[$page]; - return self::_getDocument($compo[0])->getPDFSource($type); + if ($type == 'crop') { + return self::_getDocument($compo[0])->getPDFSource($type); + } } + /** * @return array */ diff --git a/composer.lock b/composer.lock index 8a256eb72..636eac11b 100644 --- a/composer.lock +++ b/composer.lock @@ -1658,13 +1658,13 @@ "source": { "type": "git", "url": "git://git.cubedesigners.com/cubist_cms-back.git", - "reference": "2c48fbe4583d0e84a5c06ee4db3598e87f8b0aa4" + "reference": "85df36ce91c653da39fc2370d53c69b5b036efea" }, "dist": { "type": "tar", - "url": "https://composer.cubedesigners.com/dist/cubist/cms-back/cubist-cms-back-dev-master-3796f6.tar", - "reference": "2c48fbe4583d0e84a5c06ee4db3598e87f8b0aa4", - "shasum": "295d6e05cb9cca00b9a43a2acd5c149032ceab2d" + "url": "https://composer.cubedesigners.com/dist/cubist/cms-back/cubist-cms-back-dev-master-cbd892.tar", + "reference": "85df36ce91c653da39fc2370d53c69b5b036efea", + "shasum": "eae454cb5cd26fd6959ee4927a8a25ca3dd79e1d" }, "require": { "backpack/backupmanager": "^3.0", @@ -1745,7 +1745,7 @@ } ], "description": "Cubist Backpack extension", - "time": "2022-08-28T11:29:23+00:00" + "time": "2022-08-31T09:44:48+00:00" }, { "name": "cubist/cms-front", @@ -2514,16 +2514,16 @@ }, { "name": "doctrine/dbal", - "version": "3.4.2", + "version": "3.4.3", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "22de295f10edbe00df74f517612f1fbd711131e2" + "reference": "a24b89d663d8f261199bc0a91c48016042ebda85" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/22de295f10edbe00df74f517612f1fbd711131e2", - "reference": "22de295f10edbe00df74f517612f1fbd711131e2", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/a24b89d663d8f261199bc0a91c48016042ebda85", + "reference": "a24b89d663d8f261199bc0a91c48016042ebda85", "shasum": "" }, "require": { @@ -2536,8 +2536,8 @@ "psr/log": "^1|^2|^3" }, "require-dev": { - "doctrine/coding-standard": "9.0.0", - "jetbrains/phpstorm-stubs": "2022.1", + "doctrine/coding-standard": "10.0.0", + "jetbrains/phpstorm-stubs": "2022.2", "phpstan/phpstan": "1.8.2", "phpstan/phpstan-strict-rules": "^1.3", "phpunit/phpunit": "9.5.21", @@ -2605,7 +2605,7 @@ ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/3.4.2" + "source": "https://github.com/doctrine/dbal/tree/3.4.3" }, "funding": [ { @@ -2621,7 +2621,7 @@ "type": "tidelift" } ], - "time": "2022-08-21T14:21:06+00:00" + "time": "2022-08-28T17:26:36+00:00" }, { "name": "doctrine/deprecations", @@ -3492,13 +3492,13 @@ "source": { "type": "git", "url": "git://git.cubedesigners.com/fluidbook_tools.git", - "reference": "85a2d6b49d391c9f32c9c693cadae68e51c06d24" + "reference": "48b6b104cedc5d6720adfc04956d3f2ceb787230" }, "dist": { "type": "tar", - "url": "https://composer.cubedesigners.com/dist/fluidbook/tools/fluidbook-tools-dev-master-f6b05f.tar", - "reference": "85a2d6b49d391c9f32c9c693cadae68e51c06d24", - "shasum": "ea5c6799158a02b93860d358ab2185fc47870ef8" + "url": "https://composer.cubedesigners.com/dist/fluidbook/tools/fluidbook-tools-dev-master-9e79cb.tar", + "reference": "48b6b104cedc5d6720adfc04956d3f2ceb787230", + "shasum": "2b319b5661cf95f514e7a335a1756994e6bfe28e" }, "require": { "barryvdh/laravel-debugbar": "^3.6", @@ -3532,7 +3532,7 @@ } ], "description": "Fluidbook Tools", - "time": "2022-08-29T13:17:31+00:00" + "time": "2022-08-31T09:49:48+00:00" }, { "name": "genealabs/laravel-model-caching", @@ -4946,25 +4946,26 @@ }, { "name": "laravel/serializable-closure", - "version": "v1.2.0", + "version": "v1.2.1", "source": { "type": "git", "url": "https://github.com/laravel/serializable-closure.git", - "reference": "09f0e9fb61829f628205b7c94906c28740ff9540" + "reference": "d78fd36ba031a1a695ea5a406f29996948d7011b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/09f0e9fb61829f628205b7c94906c28740ff9540", - "reference": "09f0e9fb61829f628205b7c94906c28740ff9540", + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/d78fd36ba031a1a695ea5a406f29996948d7011b", + "reference": "d78fd36ba031a1a695ea5a406f29996948d7011b", "shasum": "" }, "require": { "php": "^7.3|^8.0" }, "require-dev": { - "pestphp/pest": "^1.18", - "phpstan/phpstan": "^0.12.98", - "symfony/var-dumper": "^5.3" + "nesbot/carbon": "^2.61", + "pestphp/pest": "^1.21.3", + "phpstan/phpstan": "^1.8.2", + "symfony/var-dumper": "^5.4.11" }, "type": "library", "extra": { @@ -5001,7 +5002,7 @@ "issues": "https://github.com/laravel/serializable-closure/issues", "source": "https://github.com/laravel/serializable-closure" }, - "time": "2022-05-16T17:09:47+00:00" + "time": "2022-08-26T15:25:27+00:00" }, { "name": "lavary/laravel-menu",