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);
74 return $this->repo->hasLegacyDir($this->style_id) &&
75 !$this->repo->hasImages(
77 $this->style_repo->readRid($this->style_id)
81 public function filenameExists(
string $filename): bool
95 return $this->repo->getWebPath($image->
getPath());
101 $rid = $this->style_repo->readRid($this->style_id);
102 return $this->repo->getByFilename($this->style_id, $rid,
$filename);
110 bool $constrain_proportions
112 $rid = $this->style_repo->readRid($this->style_id);
116 $tempStream = fopen(
'php://temp',
'w+');
117 stream_copy_to_stream($this->repo->getImageStream($rid,
$filename)->detach(), $tempStream);
119 $stream =
new Stream($tempStream);
121 $converter = $this->img_convert->resizeToFixedSize(
126 $this->repo->addStream(
129 $converter->getStream()
142 strtolower(pathinfo($image->getFilename(), PATHINFO_EXTENSION)),
143 [
"jpg",
"jpeg",
"gif",
"png"]
154 $this->repo->deleteImageByFilename($this->style_id,
$filename);
160 $rid = $this->style_repo->readRid($this->style_id);
162 $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)
hasLegacyDirAndNoImages()
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'))