19declare(strict_types=1);
53 $this->repo =
$repo->image();
54 $this->style_repo =
$repo->style();
57 $this->image_conversion =
$DIC->fileConverters()->legacyImages();
58 $this->img_convert =
$DIC->fileConverters()->images();
66 public function getImages(
bool $include_size_info =
false): Generator
68 $rid = $this->style_repo->readRid($this->style_id);
69 return $this->repo->getImages($this->style_id, $rid, $include_size_info);
72 public function filenameExists(
string $filename): bool
86 return $this->repo->getWebPath($image->
getPath());
92 $rid = $this->style_repo->readRid($this->style_id);
93 return $this->repo->getByFilename($this->style_id, $rid,
$filename);
101 bool $constrain_proportions
103 $rid = $this->style_repo->readRid($this->style_id);
107 $tempStream = fopen(
'php://temp',
'w+');
108 stream_copy_to_stream($this->repo->getImageStream($rid,
$filename)->detach(), $tempStream);
110 $stream =
new Stream($tempStream);
112 $converter = $this->img_convert->resizeToFixedSize(
117 $this->repo->addStream(
120 $converter->getStream()
133 strtolower(pathinfo($image->getFilename(), PATHINFO_EXTENSION)),
134 [
"jpg",
"jpeg",
"gif",
"png"]
145 $this->repo->deleteImageByFilename($this->style_id,
$filename);
151 $rid = $this->style_repo->getOrCreateRid($this->style_id, $this->stakeholder);
152 $this->repo->importFromUploadResult(
Manages access to content style editing.
Main business logic for content style images.
getImages(bool $include_size_info=false)
Get images of style.
importFromUploadResult(UploadResult $result)
Access StyleAccessManager $access_manager
supportsResize(Image $image)
resizeImage(string $filename, int $width, int $height, bool $constrain_proportions)
Filesystem Util Convert LegacyImages $image_conversion
getByFilename(string $filename)
__construct(int $style_id, Access\StyleAccessManager $access_manager, InternalRepoService $repo, protected ResourceStakeholder $stakeholder)
deleteByFilename(string $filename)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface ResourceStakeholder.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if(!file_exists('../ilias.ini.php'))