}
if ($returnJobs) {
- $res[] = new OCR($file, $this->getFluidbook()->locale);
+ $j = new OCR($file, $this->getFluidbook()->locale);
+ if ($j->isOK()) {
+ continue;
+ }
+ $res[] = $j;
} else {
$res .= Farm::OCR($file, $this->getFluidbook()->locale);
}
public function setFinish($finish = true)
{
- Cache::put($this->_cacheKey(), $finish, 1200);
+ Cache::put($this->_cacheKey(), $finish, 3600);
}
-
public function isFinish()
{
return Cache::get($this->_cacheKey(), false);
}
- public function isDone()
+ /**
+ * @return boolean
+ */
+ public function isDone($forceCheck = false)
+ {
+ return $this->isFinish() || $this->isOK($forceCheck);
+ }
+
+ public function isError()
+ {
+ return $this->isFinish() && !$this->isOK();
+ }
+
+ public function isOK($forceCheck = false)
{
return $this->isFinish();
}
return 'job_' . $this->path;
}
- /**
- * @return boolean
- */
- public function isDone($forceCheck = false)
- {
- return $this->isFinish() || $this->isOK($forceCheck);
- }
public function isOK($forceCheck = false)
{
return $this->document->hasFile($this->page, $this->format, $this->resolution, $this->quality, $this->withText, $this->withGraphics, $this->transparent, $this->version, $this->forceCheck || $forceCheck);
}
- public function isError()
- {
- return $this->isFinish() && !$this->isOK();
- }
-
/**
* @return mixed|string
*/
$imdir = 'html';
}
- for ($page = 1; $page <= $this->book->getPagesNumber(); $page++) {
- $thisrasterize = in_array($page, $rasterizePages);
- $thisimagesvg = !$thisrasterize && $svg;
- $pageBackgroundsToGenerate = $thisrasterize ? [true] : $globalBackgroundToGenerate;
- foreach ($resolutions as $r) {
- foreach ($pageBackgroundsToGenerate as $withText) {
- $this->getFile($page, $settings->imageFormat, $r, $withText, true, $transparent, $imdir);
- }
- }
- if ($thisimagesvg) {
- $this->getFile($page, 'svg', 150, true, in_array($page, $vectorPages), false, 'html');
- }
- $this->getFile($page, $settings->imageFormat, 'thumb');
- }
+// for ($page = 1; $page <= $this->book->getPagesNumber(); $page++) {
+// $thisrasterize = in_array($page, $rasterizePages);
+// $thisimagesvg = !$thisrasterize && $svg;
+// $pageBackgroundsToGenerate = $thisrasterize ? [true] : $globalBackgroundToGenerate;
+// foreach ($resolutions as $r) {
+// foreach ($pageBackgroundsToGenerate as $withText) {
+// $this->getFile($page, $settings->imageFormat, $r, $withText, true, $transparent, $imdir);
+// }
+// }
+// if ($thisimagesvg) {
+// $this->getFile($page, 'svg', 150, true, in_array($page, $vectorPages), false, 'html');
+// }
+// $this->getFile($page, $settings->imageFormat, 'thumb');
+// }
$this->book->getLinksAndRulers($links, $rulers);
$compiler = new Compiler($this->book);
if (!$jobs) {
continue;
}
- $this->jobs += $jobs;
+ $this->jobs = array_merge($this->jobs, $jobs);
+
foreach ($jobs as $job) {
if ($this->_sync) {
$job->handle();
$done = 0;
$error = 0;
+
foreach ($this->jobs as $job) {
if ($job->isDone()) {
$done++;
namespace App\Jobs;
use App\Fluidbook\Farm;
+use Cubist\Util\CommandLine\Docling;
class OCR extends BaseStatus
{
public function handle()
{
Farm::OCR($this->file, $this->locale);
- $this->setFinish();
+ }
+
+ public function isDone($forceCheck = false)
+ {
+ return $this->isOK($forceCheck);
+ }
+
+ public function isOK($forceCheck = false)
+ {
+ return Docling::isCached($this->file, $this->locale);
+ }
+
+ public function isFinish()
+ {
+ return false;
}
protected function _cacheKey(): string
{
- return 'job_ocr_' . $this->file . '_' . ($this->locale ?? '');
+ $res= 'job_ocr_' . $this->file . '_' . ($this->locale ?? '');
+ return $res;
}
+
}
},
{
"name": "aws/aws-sdk-php",
- "version": "3.369.12",
+ "version": "3.369.13",
"source": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-php.git",
- "reference": "36ee8894743a254ae2650bad4968c874b76bc7de"
+ "reference": "bedc36250c92b8287be855a2d25427fb0e065483"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/36ee8894743a254ae2650bad4968c874b76bc7de",
- "reference": "36ee8894743a254ae2650bad4968c874b76bc7de",
+ "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/bedc36250c92b8287be855a2d25427fb0e065483",
+ "reference": "bedc36250c92b8287be855a2d25427fb0e065483",
"shasum": ""
},
"require": {
"support": {
"forum": "https://github.com/aws/aws-sdk-php/discussions",
"issues": "https://github.com/aws/aws-sdk-php/issues",
- "source": "https://github.com/aws/aws-sdk-php/tree/3.369.12"
+ "source": "https://github.com/aws/aws-sdk-php/tree/3.369.13"
},
- "time": "2026-01-13T19:12:08+00:00"
+ "time": "2026-01-14T19:13:46+00:00"
},
{
"name": "backpack/backupmanager",
"source": {
"type": "git",
"url": "git://git.cubedesigners.com/cubist_util.git",
- "reference": "1c47b1f5be2cd335d034a64fe10000e59473241f"
+ "reference": "65cd40762e14da2264dbf9a8a362cd3c4846cb4a"
},
"dist": {
"type": "tar",
- "url": "https://composer.cubedesigners.com/dist/cubist/util/cubist-util-dev-master-834a22.tar",
- "reference": "1c47b1f5be2cd335d034a64fe10000e59473241f",
- "shasum": "6b0e2cfc57d879e4114031ea3f019c179ab87ce6"
+ "url": "https://composer.cubedesigners.com/dist/cubist/util/cubist-util-dev-master-2e01d2.tar",
+ "reference": "65cd40762e14da2264dbf9a8a362cd3c4846cb4a",
+ "shasum": "a4c0d149a3ba22a2d929ba4cc785d2fbdfee00aa"
},
"require": {
"cubist/net": "dev-master",
}
],
"description": "Utilities class",
- "time": "2026-01-14T18:00:53+00:00"
+ "time": "2026-01-15T17:50:37+00:00"
},
{
"name": "cviebrock/eloquent-sluggable",
"source": {
"type": "git",
"url": "git://git.cubedesigners.com/fluidbook_tools.git",
- "reference": "87006bd32ce4299a18924401eaa6c4b7a6bb26fa"
+ "reference": "86e6dfafcae904bf7a9e71e84785492a6331dc04"
},
"dist": {
"type": "tar",
- "url": "https://composer.cubedesigners.com/dist/fluidbook/tools/fluidbook-tools-dev-master-af8ec1.tar",
- "reference": "87006bd32ce4299a18924401eaa6c4b7a6bb26fa",
- "shasum": "c9e07243c7a85d9bd00b1a2ee2810c8f4984b2fb"
+ "url": "https://composer.cubedesigners.com/dist/fluidbook/tools/fluidbook-tools-dev-master-ee535f.tar",
+ "reference": "86e6dfafcae904bf7a9e71e84785492a6331dc04",
+ "shasum": "e34ed35d3e10ac66d28537c9e04bfe07685cc29e"
},
"require": {
"barryvdh/laravel-debugbar": "*",
}
],
"description": "Fluidbook Tools",
- "time": "2026-01-14T16:56:21+00:00"
+ "time": "2026-01-15T16:03:49+00:00"
},
{
"name": "fpdf/fpdf",