Files
api/services/nginx/app/classes/ocr_space.php
T
Jeppe Bundgaard 69ceafcce6 Add OCR Space module with configuration and image processing support
- Introduced `ocrSpace` module with classes: `ocr_space`, `ocrSpace_c`, and configuration objects for `enabled` and `api_key`.
- Added routes for fetching and updating OCR Space configuration.
- Created `image_processor` class and interface for handling and processing base64-encoded images.
- Integrated new traits and classes for image validation and processing.
- Updated `index.php` to include `ocr_space` and `image_processor`.
2025-08-06 10:27:39 +02:00

34 lines
633 B
PHP

<?php
namespace classes;
require_once WD . '/modules/ocrSpace/ocrSpace_c.php';
use Exception;
use interfaces\ocr_space_i;
use ocrSpace\ocrSpace_c;
class ocr_space implements ocr_space_i
{
/**
* The configuration of the module
* @var ocrSpace_c
*/
public ocrSpace_c $config;
public function __construct()
{
$this->config = new ocrSpace_c();
}
/**
* @inheritDoc
*/
public function requireModuleEnabled(): void
{
if (!(bool)$this->config->enabled->getVariableValue()) {
throw new Exception('OCR Space module is not enabled.');
}
}
}