Problem with Uploading Large Team Logo...

Everything about the STHS Web Portal - Open Source Version / Tout ce qui touché le STHS WebPortal – Open Source
Post Reply
uubeee
New in Town / Le Ptit Nouveau
Posts: 24
Joined: Tue Feb 24, 2015 12:08 pm

Problem with Uploading Large Team Logo...

Post by uubeee » Thu Jul 20, 2017 5:16 pm

using the latest portal files, everything is great except one thing.

I cannot upload any teams large logo. I get this error

Fatal error: Call to a member function getWidth() on null in /home/public_html/edit_gm.php on line 150

I thought it might be a host problem, so I tried it on another league that uses a different host. Same error. Any clues?

I looked at line 50. It's pretty basic. No idea what on that line could be causing an issue. Line 150 says...

$uploaddir = "image/logos/huge/";
$uploadfile = $uploaddir . basename($_FILES['NEW_LOGO_LARGE']['name']);
if (move_uploaded_file($_FILES['NEW_LOGO_LARGE']['tmp_name'], $uploadfile)) {
$image5 = new SimpleImage();
$image5->load($uploadfile);
if ($image5->getWidth($uploadfile) > 120 || $image->getWidth($uploadfile) < 120){ This is line 150
$image5->resize(120,120);
}
$image5->save($uploadfile);
$UPLOADED_LOGO_LARGE = basename($_FILES['NEW_LOGO_LARGE']['name']);
}else{
$UPLOADED_LOGO_LARGE = $_POST['LOGO_LARGE'];
}

Any ideas?

uubeee
New in Town / Le Ptit Nouveau
Posts: 24
Joined: Tue Feb 24, 2015 12:08 pm

Re: Problem with Uploading Large Team Logo...

Post by uubeee » Thu Jul 20, 2017 5:23 pm

Just after posting this, it hit me. LIne 150 does have an error on it.

if ($image5->getWidth($uploadfile) > 120 || $image->getWidth($uploadfile) < 120){

should be

if ($image5->getWidth($uploadfile) > 120 || $image5->getWidth($uploadfile) < 120){

you'll notice the bolded image was missing the 5 on the image.

might want to look at yours. I edited the php and tested and it works now.

Owen
The Crazy / Le Fou
Posts: 402
Joined: Tue Jan 01, 2013 12:43 pm
Contact:

Re: Problem with Uploading Large Team Logo...

Post by Owen » Sun Jul 23, 2017 11:17 pm

That's cuz Mike was a sloppy coder. 9/10 problems with the portal are a result of him not being able to spell or type properly.

Post Reply