Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento show animated gif image for product

I want to show animated gif images for product .
Uploading gif image is posible but the same is not seen on frontend.
I saw the functionality due to cache in magento animated gif images is not seen.
How can I implement it ?
Check this link for reference.
Thanks in Advance.

like image 691
RoGeR_ThAt Avatar asked Jan 04 '13 05:01

RoGeR_ThAt


1 Answers

You can implement it .
Though your caching functionality will not work for animated gif image.
copy file from

path : app/code/core/Mage/Catalog/Model/Product/Image.php to

path : app/code/local/Mage/Catalog/Model/Product/Image.php (create folders if necessary)
Find the line public function getUrl() and replace the function with:

public function getUrl()
    {
        $baseDir = Mage::getBaseDir('media');
        $file = ('gif' == strtolower(pathinfo($this->_baseFile, PATHINFO_EXTENSION))) ? $this->_baseFile : $this->_newFile;
        $path = str_replace($baseDir . DS, "", $file);
        return Mage::getBaseUrl('media') . str_replace(DS, '/', $path);
    }

Hope this will help you.

like image 179
Nikhil_K_R Avatar answered Sep 23 '22 23:09

Nikhil_K_R