From: Vincent Vanwaelscappel Date: Mon, 5 Jun 2023 12:35:18 +0000 (+0200) Subject: wip #5991 @0.25 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=aaa6c2ba946116e712e3d94e8e4a3aae70838cf9;p=fluidbook-toolbox.git wip #5991 @0.25 --- diff --git a/app/Jobs/FluidbookDocumentFileProcess.php b/app/Jobs/FluidbookDocumentFileProcess.php index 8f564bfc1..75a2db1c7 100644 --- a/app/Jobs/FluidbookDocumentFileProcess.php +++ b/app/Jobs/FluidbookDocumentFileProcess.php @@ -11,6 +11,7 @@ class FluidbookDocumentFileProcess extends Base protected $page; protected $format; protected $resolution; + protected $quality; protected $withText; protected $withGraphics; protected $version; diff --git a/app/Models/FluidbookDocument.php b/app/Models/FluidbookDocument.php index daba021d7..5ed91da81 100644 --- a/app/Models/FluidbookDocument.php +++ b/app/Models/FluidbookDocument.php @@ -280,11 +280,12 @@ class FluidbookDocument extends ToolboxModel } $file .= '.svg'; } else if ($format === 'png' || $format === 'jpg') { + $q = ($format === 'jpg' && $quality !== 85) ? '-' . $quality : ''; $prefix = $withText ? 't' : 'h'; if ($resolution === 'thumb') { - $file = $dir . 'p' . $page . '.' . $format; + $file = $dir . 'p' . $page . $q . '.' . $format; } else { - $file = $dir . $prefix . $page . '-' . $resolution . '.' . $format; + $file = $dir . $prefix . $page . '-' . $resolution . $q . '.' . $format; } } else if ($format === 'swf') { $file = $dir . 'p' . $page . '.' . $format;