chore: complete update

This commit is contained in:
2025-07-17 16:24:20 +02:00
parent 899227b0a4
commit 64a7051137
1300 changed files with 85570 additions and 2756 deletions

View File

@@ -0,0 +1,40 @@
<?php
declare(strict_types=1);
namespace App\Domain\Media;
/**
* Factory-Klasse zum Erstellen des richtigen ImageProcessor
*/
final readonly class ImageProcessorFactory
{
/**
* Erstellt den optimalen ImageProcessor je nach verfügbaren Extensions
*
* @return ImageProcessorInterface Die beste verfügbare Implementation
*/
public static function create(): ImageProcessorInterface
{
// Prüfen ob ImageMagick verfügbar ist
if (extension_loaded('imagick') && class_exists('\Imagick')) {
try {
// Test ob ImageMagick funktioniert
$test = new \Imagick();
$test->clear();
return new ImagickImageProcessor();
} catch (\Exception $e) {
error_log('ImageMagick is installed but not working: ' . $e->getMessage());
}
}
// Fallback auf GD
if (extension_loaded('gd') && function_exists('imagecreatetruecolor')) {
return new GdImageProcessor();
}
throw new \RuntimeException(
'No image processing library available. ' .
'Please install and enable either the ImageMagick or GD PHP extension.'
);
}
}