1
j0sh78
upload and resizing picture
  • 2004/11/19 10:17

  • j0sh78

  • Friend of XOOPS

  • Posts: 53

  • Since: 2004/10/21


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

2
jlm69
Re: upload and resizing picture
  • 2005/1/27 15:56

  • jlm69

  • Module Developer

  • Posts: 719

  • Since: 2002/7/19


Which version of uploader.php or XOOPS is this for? I see this on line 301-306
---------------------------------------------------
}
return true;
}

/**
* Copy the file to its destination
----------------------------------------------------
This must not be the same as you are talking about.

I could really use something like this. Maybe you could explain it a little better.
Thanks,
John*/

3
neester
Re: upload and resizing picture
  • 2005/2/28 7:11

  • neester

  • Just popping in

  • Posts: 1

  • Since: 2005/2/28


Ahh would be a great hack if it worked :(

Thanks!

4
izzzy
Re: upload and resizing picture
  • 2005/3/15 14:11

  • izzzy

  • Just popping in

  • Posts: 43

  • Since: 2004/5/27


Did anybody there already get that to solve? I have the same possession.

Herko? Mithrandir? Onokazu? Where you?

Login

Who's Online

306 user(s) are online (209 user(s) are browsing Support Forums)


Members: 0


Guests: 306


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits