cancel
Showing results for 
Search instead for 
Did you mean: 

Animated Gifs

Animated Gifs

I'm trying to add animated gifs to my product pages through the admin. I can add them, but when I view them on the front end they just come through as the separate images. How can I fix this?

2 REPLIES

Re: Animated Gifs

copy file from the 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);
}
Go to admin > Cache Management and clear all cache then Refresh product.
 

 

Elsner Technologies

Re: Animated Gifs

edit file on -> .\vendor\magento\module-catalog\Model\View\Asset\Image.php

 

on function getAbsolutePath($result) and  private function getRelativePath($result)

 check are file contain .gif or not?
if true then dont use cache image, if false use cache image.
=======================================
if (strpos( $this->getFilePath(), '.gif') !== false) {
$result = $this->join($result, $this->getFilePath());
}
else{
$result = $this->join($result, $this->getModule());
$result = $this->join($result, $this->getMiscPath());
$result = $this->join($result, $this->getFilePath());
}
 ====================