public function getUrl() { if ($this->_imageShouldComeFromCloudinary($this->_newFile)) { $imageProvider = CloudinaryImageProvider::fromConfiguration($this->_getConfigHelper()->buildConfiguration()); return (string) $imageProvider->transformImage(Image::fromPath($this->_newFile)); } return parent::getUrl(); }
/** * Provides the URL to the image on the CDN or fails back to the parent method as appropriate. * * @return string */ public function getUrl() { if (!Mage::getStoreConfig('mycdn/general/enabled')) { return parent::getUrl(); } $cache = Mage::helper('mycdn')->checkPathInCache($this->_newFile); if (!$cache) { return parent::getUrl(); } return Mage::getModel('mycdn/adapter')->getUrl($this->_newFile); }
/** * Provides the URL to the image on the CDN or fails back to the parent method as appropriate. * * @return string */ public function getUrl() { $cds = Mage::Helper('imagecdn')->factory(); if ($cds->useCdn()) { $url = $cds->getUrl($this->_newFile); if ($url) { return $url; } } return parent::getUrl(); }
/** * @param Mage_Catalog_Model_Product_Image $model * @depends testSetBaseFilePlaceholder */ public function testGetUrlPlaceholder($model) { $this->assertStringMatchesFormat('http://localhost/pub/media/skin/frontend/%s/Mage_Catalog/images/product/placeholder/image.jpg', $model->getUrl()); }
/** * @return string */ public function getUrl() { if ($this->_newFile === true) { $url = Mage::getDesign()->getSkinUrl('Mage_XmlConnect::images/catalog/category/placeholder/' . $this->getDestinationSubdir() . '.jpg'); } else { $url = parent::getUrl(); } return $url; }