19 declare(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();
68 $rid = $this->style_repo->readRid($this->style_id);
69 return $this->repo->getImages($this->style_id, $rid);
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);
104 if ($this->filenameExists($filename)) {
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(
getByFilename(string $filename)
getImages()
Get images of style.
Filesystem Util Convert LegacyImages $image_conversion
importFromUploadResult(UploadResult $result)
Main business logic for content style images.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
deleteByFilename(string $filename)
resizeImage(string $filename, int $width, int $height, bool $constrain_proportions)
supportsResize(Image $image)
Manages access to content style editing.
__construct(int $style_id, Access\StyleAccessManager $access_manager, InternalRepoService $repo, protected ResourceStakeholder $stakeholder)
Interface ResourceStakeholder.
Access StyleAccessManager $access_manager