Error on submitting match report

For the 1on1 Ladder on PlanetNexuiz

Moderators: Nexuiz Moderators, Moderators, Ladder Moderators

Error on submitting match report

Postby Ed » Wed Mar 29, 2006 7:50 pm

Selected screenshots, entered scores, entered description, it throws this up:
Code: Select all
Warning: mkdir(/home/nexuiz/domains/planetnexuiz.com/public_html/ladder/matchfiles/191): File exists in /home/nexuiz/domains/planetnexuiz.com/public_html/ladder/includes/writereport.php on line 168

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 3200 bytes) in /home/nexuiz/domains/planetnexuiz.com/public_html/ladder/includes/functions.inc.php on line 356


Badness. Can't submit match report. :cry:
Ed
Forum addon
 
Posts: 1172
Joined: Wed Mar 01, 2006 12:32 am
Location: UK

Postby GreEn`mArine » Wed Mar 29, 2006 7:59 pm

I have NO IDEA

somehow the server's memory is full

the "file exists" warning isn't too bad, it just means that the script has already created the match-folder. however the matchfolder would only have been generated the first time you start uploading. This means that this first Warning message can ONLY appear if you did a matchreport and s.th. failed there (eg. only shjowing the second fatal error msg), and then retrying to upload causes this message with mkdir

Perhaps the planetnexuiz.com machine has to be restarted, I have to idea why this error msg comes up

EDIT:
I was using Google a bit. It seems that your screenshot(s) are too big (resultion). that will cause the uncompressed image to be greater than 8 MB (the image gets first decompressed and then recompressed/sized again which takes up quite some memory)

I'll however try to up these 8 MB-Limitto 16 MB.
IRC quote:
[kojn] I've been coming a bit more recently
[kojn] she took it the dirty way
GreEn`mArine
Forum addon
 
Posts: 1509
Joined: Tue Feb 28, 2006 9:33 pm
Location: Germany

Postby GreEn`mArine » Wed Mar 29, 2006 8:11 pm

@Willis: Please change the value "memory_limit" in the php.ini file from "8M" to something bigger, e.g. "16M"
IRC quote:
[kojn] I've been coming a bit more recently
[kojn] she took it the dirty way
GreEn`mArine
Forum addon
 
Posts: 1509
Joined: Tue Feb 28, 2006 9:33 pm
Location: Germany

Postby KadaverJack » Wed Mar 29, 2006 9:28 pm

GreEn`mArine wrote:@Willis: Please change the value "memory_limit" in the php.ini file from "8M" to something bigger, e.g. "16M"

That would be a really bad solution for 2 reasons:
1) that doesn't solve the problem for high resolutions (1600x1200 takes almost 60MB uncompressed)
and 2) if more users are submitting their reports at once, you will always have problems with the memory limit, no matter how large it is.

So you should either optimize that function for memory usage or force the users to resize and jpeg their screenshots by enforcing a maximum filesize for uploaded screens.
KadaverJack
Site admin and forum addon
 
Posts: 1102
Joined: Tue Feb 28, 2006 9:42 pm

Postby tChr » Wed Mar 29, 2006 9:37 pm

The default limit of 8MB is _very_ conervative. Most of my server run at 64 or 128MB, however, you are right that you oculd easily set a max upload filesize to something sane, or you could simply let them stay full-quality on the server.
the spice extend life!
the spice expand conciousness!
the spice is vital to space travel!
sooooo.. tell me what you want, waht you really-really want
I will proceed directly to the intravenous injection of hard drugs, please.
tChr
Forum addon
 
Posts: 1501
Joined: Tue Feb 28, 2006 9:11 pm
Location: Trondheim, Norway

Postby GreEn`mArine » Thu Mar 30, 2006 1:50 pm

The function itself cannot be optimized on the server, as it is part of PHP and PHP is known to be a waste of resources and being slow :D

I gonna think about a "too big filesize" error msg, allowing 1280x1024 at max.

Can anyone tell me how big this will be in MB ? so that the memory_limit get's upped to this value ?
IRC quote:
[kojn] I've been coming a bit more recently
[kojn] she took it the dirty way
GreEn`mArine
Forum addon
 
Posts: 1509
Joined: Tue Feb 28, 2006 9:33 pm
Location: Germany

Postby tChr » Thu Mar 30, 2006 1:56 pm

GreEn`mArine wrote:The function itself cannot be optimized on the server, as it is part of PHP and PHP is known to be a waste of resources and being slow :D

I gonna think about a "too big filesize" error msg, allowing 1280x1024 at max.

Can anyone tell me how big this will be in MB ? so that the memory_limit get's upped to this value ?


1280 times 1024 times 3 (bytes pr pixel) uncompressed. (roughly) Thats less than 4MB but thats for the orig image. I assume you use GD to resize the image, then the memry of the new pic you created is added, and during the resize, you have several layers.. but I guess 16 should do fine.

you might want to try and create a .htacces file with this content:
php_flag memory_limit 16MB
or is it:
php_ini memory_limit 16MB

I'm not sure you are allowed to change this in the .htaccess though. This aslo depends on the server setup.

Edit:
I have a finished image_resize funciont that should be quite effective. Let me know if you want it.
the spice extend life!
the spice expand conciousness!
the spice is vital to space travel!
sooooo.. tell me what you want, waht you really-really want
I will proceed directly to the intravenous injection of hard drugs, please.
tChr
Forum addon
 
Posts: 1501
Joined: Tue Feb 28, 2006 9:11 pm
Location: Trondheim, Norway

Postby GreEn`mArine » Thu Mar 30, 2006 3:21 pm

Code: Select all
function resizeToFile ($sourcefile, $dest_x, $dest_y, $targetfile, $jpegqual, $fileype)
{
 

/* Get the dimensions of the source picture */
   if ($fileype == "image/jpeg" || $fileype == "image/jpg" ||$fileype == "image/pjpeg")
   {
      
   }
   $picsize=getimagesize("$sourcefile");

   $source_x  = $picsize[0];
   $source_y  = $picsize[1];
   if ($fileype == "image/jpeg" || $fileype == "image/jpg" ||$fileype == "image/pjpeg")
   {
      $source_id = imageCreateFromJPEG("$sourcefile");
   }
   if ($fileype == "image/gif")
   {
      $source_id = imageCreateFromGIF("$sourcefile");
   }
   

/* Create a new image object (not neccessarily true colour) */
     
   $target_id=imagecreatetruecolor($dest_x, $dest_y);

/* Resize the original picture and copy it into the just created image
   object. Because of the lack of space I had to wrap the parameters to
   several lines. I recommend putting them in one line in order keep your
   code clean and readable */
     

   $target_pic=imagecopyresampled($target_id,$source_id,0,0,0,0,$dest_x,$dest_y,$source_x,$source_y);

/* Create a jpeg with the quality of "$jpegqual" out of the
   image object "$target_pic".
   This will be saved as $targetfile */

   imagejpeg ($target_id,"$targetfile",$jpegqual);

   return true;

}


This is the current method. I don't know whether GD is even installed on the server and whether these functions ARE the GD ones or not, I have not really been keen on this imageresizing anyway ^^ but I wanted all images to be standardised and have the same size
IRC quote:
[kojn] I've been coming a bit more recently
[kojn] she took it the dirty way
GreEn`mArine
Forum addon
 
Posts: 1509
Joined: Tue Feb 28, 2006 9:33 pm
Location: Germany

Postby tChr » Thu Mar 30, 2006 3:29 pm

These look like GD functiions so it should be ok good.

You might want to add the following at the end (just before the return):

imagedestroy($source_id);
imagedestroy($target_id);

this will tell the engine you are done with the recources and free the memory they've used.
the spice extend life!
the spice expand conciousness!
the spice is vital to space travel!
sooooo.. tell me what you want, waht you really-really want
I will proceed directly to the intravenous injection of hard drugs, please.
tChr
Forum addon
 
Posts: 1501
Joined: Tue Feb 28, 2006 9:11 pm
Location: Trondheim, Norway


Return to Nexuiz Ladders - 1on1

Who is online

Users browsing this forum: No registered users and 1 guest

cron