Page 3 of 3

Re: Server side image resize on upload

Posted: Wed Oct 09, 2013 4:09 am
by Lumpy Burgertushie
sorry but if you can't find your files then you may not be ready for MODDing the code yet. ;)

there is a folder named includes, all of the functions files are in that folder.


luck,
robert

Re: Server side image resize on upload

Posted: Tue Jul 29, 2014 3:05 am
by beltguy
Sorry to drag this up again.

I have been trying to get a server side image resize modification to work.

I have the same forum on two different sites one I will call test and one public (both on GoDaddy).

On the test site, I applied a mod described here: http://jerrywalsh.org/2009/automaticall ... -0409.html It worked great on the test site but not the public site. This is described in this thread: viewtopic.php?f=46&t=2250146&p=13665951 ... #p13665951

As I mentioned in that thread, I compared every ACP setting and any related function_xxx programs and they all looked the same.

I finally gave up and tried the mod in this thread. I am pretty sure I pasted the two scripts in the correct place and cleared the cache. I don't get an error message, but I do get a screen in the main website (WP format) that says file not found. Wish I got an error message, but no such luck.

I tried changing the htaccess file in the root directory with the suggested addition, but the result is that I am blocked from accessing the forum. When I deleted the modification I am then able to access the forum.

Since neither mod worked, I suspect there is some setting in ACP that is still not right.

I have spent many hours on this effort. The "public" forum will go public in a couple of weeks and I really would like to have one of these mods working.

Any help appreciated

Jim

Re: Server side image resize on upload

Posted: Tue Jul 29, 2014 6:34 am
by Oyabun1
As you were told in your other topic on this issue the problem is likely nothing to do with phpBB or ACP settings, but because of resource limits on your server. Resizing huge images requires a considerable amount of resources (considerable in server terms).

Re: Server side image resize on upload

Posted: Tue Jul 29, 2014 1:06 pm
by beltguy
I had replied that GoDaddy is very generous with a 32M limit in php.ini

Also, I am testing with a 1.2M picture.

Jim

Re: Server side image resize on upload

Posted: Wed Jul 30, 2014 3:42 pm
by beltguy
OK, at the risk of upsetting folks reading this thread, I have to ask the question: Is there a possibility that the WordPress side of our site is causing a conflict with posting uploading large photo (up to 2M)?

I ask this because neither this mod, or the Jerry Walsh mod work. The Jerry Walsh mod worked fine on my test site where the site directory does not have a WP installation. Also, while there is no error message for the photo upload, it does give me a "file not found" in a WP related screen.

Jim

Re: Server side image resize on upload

Posted: Thu Jul 31, 2014 2:22 pm
by Mick
@beltguy: The simple answer is 'possibly'. Can you disable WP and try it?

Re: Server side image resize on upload

Posted: Sun Nov 02, 2014 1:53 pm
by hershuk
blackbird.rus wrote:functions_upload.php
Add function

Code: Select all

	
/**
* Resize images with the true diemensions (800*600)
*/
function resize_images()
{
	if ( $this->is_image() ) {
	$limite_largeur = "800px";
	$limite_hauteur = "600px";
	$size = getimagesize($this->destination_file);
	$largeur = $size[0];
	$hauteur = $size[1];
	if($hauteur > $limite_hauteur OR $largeur > $limite_largeur)
	{
	if($largeur > $limite_largeur)
	{
	$hauteur = $hauteur / ($largeur / $limite_largeur);
	$largeur = $limite_largeur;
	}
	if($hauteur > $limite_hauteur)
	{
	$largeur = $largeur / ($hauteur / $limite_hauteur);
	$hauteur = $limite_hauteur;
	}
	
	$destination = imagecreatetruecolor($largeur, $hauteur);
	if ( $this->extension == "jpg" || $this->extension == "jpeg" ) $source = imagecreatefromjpeg($this->destination_file);
	elseif ( $this->extension == "png" ) $source = imagecreatefrompng($this->destination_file);
	elseif ( $this->extension == "gif" ) $source = imagecreatefromgif($this->destination_file);
				
	imagecopyresampled($destination, $source, 0, 0, 0, 0, $largeur, $hauteur, $size[0], $size[1]);
	if ( $this->extension == "jpg" || $this->extension == "jpeg" ) imagejpeg($destination, $this->destination_file);
	elseif ( $this->extension == "png" ) imagepng($destination, $this->destination_file);
	elseif ( $this->extension == "gif" ) imagegif($destination, $this->destination_file);
	}
}
}
in function "move_file" add

Code: Select all

	if ( $this->is_image() ) 
	{
		$this->resize_images();
	}
befor

Code: Select all

	phpbb_chmod($this->destination_file, $chmod); 
There is no "move_file" function in my "functions_upload.php"