2 namespace TYPO3\CMS\Extbase\Service;
65 if (is_callable(array($image,
'getOriginalFile'))) {
67 $image = $image->getOriginalFile();
73 return $processedImage;
87 $parsedUrl = parse_url($imageUrl);
89 if (isset($parsedUrl[
'host'])) {
91 }
elseif ($this->environmentService->isEnvironmentInFrontendMode()) {
92 $uriPrefix =
$GLOBALS[
'TSFE']->absRefPrefix;
100 if (isset($parsedUrl[
'host']) && !isset($parsedUrl[
'scheme'])) {
105 return $uriPrefix . $imageUrl;
123 public function getImage($src, $image, $treatIdAsReference)
125 if (is_null($image)) {
127 }
elseif (is_callable(array($image,
'getOriginalResource'))) {
129 $image = $image->getOriginalResource();
133 throw new \UnexpectedValueException(
'Supplied file object type ' . get_class($image) .
' must be File or FileReference.', 1382687163);
148 if ($this->environmentService->isEnvironmentInBackendMode() && substr($src, 0, 3) ===
'../') {
149 $src = substr($src, 3);
152 if ($treatIdAsReference) {
153 $image = $this->resourceFactory->getFileReferenceObject($src);
155 $image = $this->resourceFactory->getFileObject($src);
159 $image = $this->resourceFactory->retrieveFileOrFolderObject($src);
173 if ($this->environmentService->isEnvironmentInFrontendMode()) {
175 $GLOBALS[
'TSFE']->lastImageInfo = $imageInfo;
176 $GLOBALS[
'TSFE']->imagesOnPage[] = $imageInfo[3];
191 if (isset(
$GLOBALS[
'TSFE']->tmpl->fileCache[$hash])) {
192 $compatibilityImageResourceValues =
$GLOBALS[
'TSFE']->tmpl->fileCache[$hash];
194 $compatibilityImageResourceValues = array(
200 'origFile_mtime' => $processedImage->
getOriginalFile()->getModificationTime(),
204 'processedFile' => $processedImage,
205 'fileCacheHash' => $hash
208 return $compatibilityImageResourceValues;