Пример #1
0
 public function getThumbnailUrl($filePath, $checkFile = false)
 {
     if ($this->_imageShouldComeFromCloudinary($filePath)) {
         $imageProvider = $this->_buildImageProvider();
         $imageDimensions = $this->_buildImageDimensions();
         $defaultTransformation = $this->_getConfigHelper()->buildConfiguration()->getDefaultTransformation();
         return (string) $imageProvider->transformImage(Image::fromPath($filePath), $defaultTransformation->withDimensions($imageDimensions));
     }
     return parent::getThumbnailUrl($filePath, $checkFile);
 }
Пример #2
0
 /**
  * Thumbnail URL getter
  *
  * @param  string $filePath original file path
  * @param  boolean $checkFile OPTIONAL is it necessary to check file availability
  * @return string | false
  */
 public function getThumbnailUrl($filePath, $checkFile = false)
 {
     if (!Mage::helper('uaudio_storage')->isEnabled()) {
         return parent::getThumbnailUrl($filePath, $checkFile);
     }
     if (!$this->_getStorageModel()->fileExists($filePath)) {
         return false;
     }
     $dest = $this->resizeFile($filePath);
     if ($dest) {
         return Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . $dest;
     }
     return false;
 }