Exemplo n.º 1
0
 /**
  * Wrapper for cObj->getImageResource in FE and BE
  *
  * @param Tx_Yag_Domain_Model_Item $origFile The original image
  * @param string $sourcePathAndFileName Must be used to access the file, as it may be overwritten if the original file was not found
  * @param Tx_Yag_Domain_Configuration_Image_ResolutionConfig $resolutionConfiguration
  * @return TYPO3\CMS\Core\Resource\ProcessedFile
  */
 protected function getImageResource(Tx_Yag_Domain_Model_Item $origFile, $sourcePathAndFileName, Tx_Yag_Domain_Configuration_Image_ResolutionConfig $resolutionConfiguration)
 {
     $typoScriptSettings = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Service\\TypoScriptService')->convertPlainArrayToTypoScriptArray($resolutionConfiguration->getSettings());
     $contentObject = $this->configurationManager->getContentObject();
     /** @var $contentObject \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer */
     if ($resolutionConfiguration->getMode() == 'GIFBUILDER') {
         $gifBuilderData = ['yagImage' => $sourcePathAndFileName, 'yagImageTitle' => $origFile->getTitle(), 'yagImageHref' => $origFile->getHref(), 'yagImageUid' => $origFile->getUid(), 'yagAlbumUid' => $origFile->getAlbum()->getUid(), 'yagAlbumTitle' => $origFile->getAlbum()->getName(), 'yagGalleryUid' => $origFile->getAlbum()->getGallery()->getUid(), 'yagGalleryTitle' => $origFile->getAlbum()->getGallery()->getName()];
         $contentObject->start($gifBuilderData);
         $imageResource = $contentObject->getImgResource('GIFBUILDER', $typoScriptSettings);
     } else {
         $fileObject = $this->getResourceFactory()->retrieveFileOrFolderObject($sourcePathAndFileName);
         $imageResource = $contentObject->getImgResource($fileObject, $typoScriptSettings);
     }
     //   $this->typo3CleanUp($imageResource);
     return $imageResource['processedFile'];
 }
Exemplo n.º 2
0
 protected function buildItemObjectInfo(PathInfo $pathInfo, \Tx_Yag_Domain_Model_Item $item)
 {
     return array('size' => $item->getFilesize(), 'atime' => $item->getTstamp()->getTimestamp(), 'mtime' => $item->getTstamp()->getTimestamp(), 'ctime' => $item->getCrdate()->getTimestamp(), 'mimetype' => 'image/jpeg', 'yagItem' => $item, 'name' => $item->getOriginalFilename(), 'identifier' => \Tx_Yag_Domain_FileSystem_Div::concatenatePaths(array($pathInfo->getAlbumPath(), $item->getTitle() . ' |' . $item->getUid())), 'storage' => $this->storage->getUid(), 'description' => $item->getDescription(), 'title' => $item->getTitle(), 'href' => $item->getHref(), 'hrefTarget' => $item->getHrefTarget(), 'height' => $item->getHeight(), 'width' => $item->getWidth(), 'sourceUri' => $item->getSourceuri());
 }