Avatar Resizing

16 years 8 months ago #42469 by Friedl
Avatar Resizing was created by Friedl
Hi, you forgot to implement this code

[code:1] // resize to thumbnail...
// resize thumb fix - check if the image file is bigger than allowed thumbnail
if($imginfo[0] > $this->_thumbwidth || $imginfo[1] > $this->_maxheight){
if(!$this->resizeImage($file, $thumbfile, $this->_thumbwidth, $this->_thumbheight, $filename)){
$this->raiseError("Error: resizing thumbnail image failed."«»);
return false;
}
// resize thumb fix - else, just copy the file to the thumbnail file
} else {
if (!@copy($file, $thumbfile)){
// some error occured while copying the file to the thumbnail file
$this->raiseError("Error occurred copying the uploaded file to the thumbnail."«»);
return false;
}
}
[/code:1]

which allows to have animated avatars, if they are not bigger as the defined size.

This code is not from me, its from the user wingflap.
Thread here: www.joomlapolis.com/component/option,com_joomlaboard/Itemid,/func,view/catid,29/id,38222/#38222

Please Log in to join the conversation.

16 years 8 months ago #42475 by nant
Replied by nant on topic Re:Avatar Resizing
Actually, we did discuss this option with Beat.

We decided that it would be a security risk to allow animated gifs as in many cases such technics are used to execute code remotely.

Maybe I am not explaining this properly (will ask Beat to assist) - either way the suggestion is public and folks can implement at their own risk - thank you and wingflap of course.

Please Log in to join the conversation.

16 years 8 months ago #42506 by Friedl
Replied by Friedl on topic Re:Avatar Resizing
Ok, well. So whoever want to implement this, search for the line
[code:1]// resize to thumbnail...[/code:1] in administrator/components/com_comprofiler/ImgToolbox.class.php and paste the code above from this line till [code:1]return false;

}[/code:1]

It works fine!

Post edited by: Friedl, at: 2007/08/10 17:32

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.180 seconds

Facebook Twitter LinkedIn