if($fileInfo !== null && $fileInfo !== false) {
$fileId = $fileInfo->getId();
- $previewPath = $this->getThumbnailsFolder() . '/' . $fileId . '/';
+ $previewPath = $this->getPreviewPath($fileId);
$this->userView->deleteAll($previewPath);
return $this->userView->rmdir($previewPath);
}
return array();
}
- $previewPath = $this->getThumbnailsFolder() . '/' . $fileId . '/';
+ $previewPath = $this->getPreviewPath($fileId);
$wantedAspectRatio = (float) ($this->getMaxX() / $this->getMaxY());
$this->preview = $preview;
$this->resizeAndCrop();
- $previewPath = $this->getThumbnailsFolder() . '/' . $fileId . '/';
+ $previewPath = $this->getPreviewPath($fileId);
$cachePath = $this->buildCachePath($fileId);
if ($this->userView->is_dir($this->getThumbnailsFolder() . '/') === false) {
$maxX = $this->getMaxX();
$maxY = $this->getMaxY();
- $previewPath = $this->getThumbnailsFolder() . '/' . $fileId . '/';
- $preview = $previewPath . $maxX . '-' . $maxY . '.png';
+ $previewPath = $this->getPreviewPath($fileId);
+ $preview = $previewPath . strval($maxX) . '-' . strval($maxY);
if ($this->keepAspect) {
- $preview = $previewPath . $maxX . '-with-aspect.png';
- return $preview;
+ $preview .= '-with-aspect';
}
+ $preview .= '.png';
+
return $preview;
}
+
+
+ private function getPreviewPath($fileId) {
+ return $this->getThumbnailsFolder() . '/' . $fileId . '/';
+ }
}