commit 08-2025
This commit is contained in:
parent
9ae662f63e
commit
480fdc65ed
404 changed files with 65310 additions and 2600431 deletions
|
|
@ -7,8 +7,9 @@ use App\Models\DcFile;
|
|||
use App\Services\Util;
|
||||
use App\Models\DcFileTag;
|
||||
use App\Repositories\BaseRepository;
|
||||
use Intervention\Image\Facades\Image;
|
||||
use Imagick;
|
||||
use Intervention\Image\ImageManager;
|
||||
use Imagick;
|
||||
use ImagickException;
|
||||
|
||||
class FileRepository extends BaseRepository {
|
||||
|
||||
|
|
@ -88,21 +89,22 @@ class FileRepository extends BaseRepository {
|
|||
|
||||
private function processImage(string $path, string $filename): void
|
||||
{
|
||||
// ImageManager initialisieren (standardmäßig mit GD)
|
||||
$manager = ImageManager::gd();
|
||||
|
||||
// Thumbnail
|
||||
$img = Image::make($path);
|
||||
$img->resize(542, 360, function ($c) {
|
||||
$c->aspectRatio();
|
||||
$c->upsize();
|
||||
});
|
||||
\Storage::disk('public')->put('dc/thumb/'.basename($filename), (string) $img->encode());
|
||||
$thumbImage = $manager->read($path);
|
||||
$thumbImage->scaleDown(width: self::THUMB_WIDTH, height: self::THUMB_HEIGHT);
|
||||
\Storage::disk('public')->put('dc/thumb/'.basename($filename), (string) $thumbImage->toJpeg());
|
||||
|
||||
// Big image
|
||||
$img = Image::make($path);
|
||||
$img->resize(1600, 900, function ($c) {
|
||||
$c->aspectRatio();
|
||||
$c->upsize();
|
||||
});
|
||||
\Storage::disk('public')->put('dc/big/'.basename($filename), (string) $img->encode());
|
||||
$bigImage = $manager->read($path);
|
||||
$bigImage->scaleDown(width: self::BIG_WIDTH, height: self::BIG_HEIGHT);
|
||||
\Storage::disk('public')->put('dc/big/'.basename($filename), (string) $bigImage->toJpeg());
|
||||
|
||||
// Ressourcen freigeben nicht mehr nötig in v3
|
||||
// $thumbImage->destroy();
|
||||
// $bigImage->destroy();
|
||||
}
|
||||
|
||||
private function processPdf(string $path, string $filename): void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue