46 $this->upload = $service->
upload();
61 public function copy(
int $target_obj_id)
72 '/(' .
"tile_image_" .
')(\d*)\/(.*)$/',
73 '${1}' . $target_obj_id .
'/${3}',
87 public function delete()
89 if ($this->web->hasDir($this->getRelativeDirectory())) {
108 if ($this->web->has($file_name)) {
109 $this->web->delete($file_name);
112 if ($this->upload->hasUploads()) {
113 if (!$this->upload->hasBeenProcessed()) {
114 $this->upload->process();
118 $results = $this->upload->getResults();
121 $this->ext = pathinfo(
$result->getName(), PATHINFO_EXTENSION);
124 $this->upload->moveOneFileTo(
127 \
ILIAS\FileUpload\Location::WEB,
134 list($width, $height,
$type, $attr) = getimagesize($fullpath);
135 $min = min($width, $height);
136 ilUtil::execConvert($fullpath .
"[0] -geometry " . $min .
"x" . $min .
"^ -gravity center -extent " . $min .
"x" . $min .
" " . $fullpath);
182 return implode(DIRECTORY_SEPARATOR, [
185 "tile_image_" . $this->obj_id
202 return implode(DIRECTORY_SEPARATOR, [
225 return implode(DIRECTORY_SEPARATOR, [
240 $target_dir = implode(DIRECTORY_SEPARATOR, [
__construct(ilObjectService $service, int $obj_id)
Constructor.
persistImageState($filename)
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
exists()
Does tile image file exist?bool
getExtension()
Get extenstion.string
copy(int $target_obj_id)
Copy tile image to repository object.
createFromImportDir($source_dir, $ext)
static execConvert($args)
execute convert command
filesystem()
Get filesystems.
static _deleteContainerSettings($a_id, $a_keyword=null, $a_keyword_like=false)
saveFromHttpRequest(string $tmpname)
Save image from request.
getFullPath()
Get full path of the tile image file.string
static _writeContainerSetting($a_id, $a_keyword, $a_value)
static getWebspaceDir($mode="filesystem")
get webspace directory
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.