Animated gif thumbnail resizing fix

18 years 3 weeks ago #9440 by orgarob
Animated gif thumbnail resizing fix was created by orgarob
The resizing of animated gifs into thumbnails was not working properly on my site. I hacked up the file

administrator/components/com_comprofiler/imgToolbox.class.php

to coalesce all .gif files first before resizing them. Animated gifs are now properly displayed when converted to thumbnails.


[code:1] function resizeImageIM($src_file, $dest_file, $destWidth,$destHeight){
//$cmd = $this->_IM_path."convert -resize $new_size \"$src_file\" \"$dest_file\"";
if (preg_match ("/\.gif$/", "$src_file"«»)) {
$cmd = "'".$this->_IM_path."convert' -coalesce '$src_file' '$src_file'";
$output=array();
exec($cmd, $output, $retval);
}

$cmd = "'".$this->_IM_path."convert' -geometry $destWidth x $destHeight '$src_file' '$dest_file'";
$output=array();
exec($cmd, $output, $retval);
if($this->debug()) {
echo "<div>cmd=$cmd<br/>output=". join("\n", $output)."</div>";
}
return true;
}
[/code:1]

Please Log in to join the conversation.

18 years 3 weeks ago #9453 by pcjunkie
Replied by pcjunkie on topic Re:Animated gif thumbnail resizing fix
nice good work, I have been trying to place flash in there as well. I found code on another site, I think it was Joomlaboard.

[code:1]
//swf

$sb_message_txt = preg_replace("/\[swf\](.*?)\[\/swf\]/si","<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http:\/\/fpdownload.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=6,0,0,0\" width=\"400\" height=\"300\" align=\"middle\"><param name=\"movie\" value=\"$1\"
><embed src=\"$1\" quality=\"high\" bgcolor=\"#ffffff\" width=\"400\" height=\"300\" align=\"
middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http:
\/\/www.macromedia.com\/go\/getflashplayer\" \/><\/object>",$sb_message_txt);
[/code:1]

Not sure if this works though. I am still yet to try it.
Found here.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.312 seconds

Facebook Twitter LinkedIn