1
hi all
in my community (
http://www.pixaelcity.com) i've simple modify upload avatar to upload picture
i worked on uploader.php in /class
1) uncomment line 301 to 306... picture will resize automatically by imagemagick
2) add this code on line 338
$this->mediaDimention=getimagesize($this->mediaTmpName);
if($this->mediaDimention[0] > $this->maxWidth){
exec("mogrify -geometry ".$this->maxWidth." -quality 70 -sharpen 0.0x1.0 ".$this->mediaTmpName);
}
image will resize on max width that you have inserted in admin panel
in alternative you can use this code
if($this->mediaDimention[0] > $this->mediaDimention[1] && $this->mediaDimention[0] > $this->maxWidth){
exec("mogrify -geometry ".$this->maxWidth." -quality 70 -sharpen 0.0x1.0 ".$this->mediaTmpName);
}
if($this->mediaDimention[1] > $this->mediaDimention[0] && $this->mediaDimention[1] > $this->maxHeight){
exec("mogrify -geometry x".$this->maxHeight." -quality 70 -sharpen 0.0x1.0 ".$this->mediaTmpName);
}
to check max width or height