Reply to Image resizing or conversion works on Windows but not on Linux VPS

Image resizing or conversion works on Windows but not on Linux VPS new!
by surz, 10 years ago
I've this piece of code which works perfectly on Windows but does not work in Linux VPS. On Windows I can overwrite the image with a new one, convert to 'jpg' and also resize to 128x128. I checked the logs

$foo->log says
-no image processing wanted

image 'upload' directory has permission set to 755
drwxr-xr-x 3 apache apache 4096 May 26 15:03 uploads

My php.ini
memory_limit = 128M

$foo = new upload ( $file );
if ($foo->uploaded) {
	if ($info [2] !== IMAGETYPE_JPEG) {
		$foo->image_convert = 'jpg';
	}
	// check width and height
	if ($info [0] > 750 || $info [1] > 540) {
		$foo->image_resize = true;
		$foo->image_ratio_crop = true;
		$foo->image_x = 750;
		$foo->image_y = 540;
	}
	// save uploaded image with a new name
	$foo->file_new_name_body = $fileName;
	$foo->file_overwrite = true;
	$foo->process ( $filePathOnServer );
	if (! $foo->processed) {
		reportErrorAndExit ( $foo->error );
	}

	// profile - 128px, others - 38px
	$foo->file_new_name_body = $fileName . '_thumbnail';
	$foo->file_overwrite = true;
	$foo->image_convert = 'jpg';
	$foo->image_resize = true;
	$foo->image_ratio_crop = true;
	$foo->image_x = 128;
	$foo->image_y = 128;
	$foo->process ( $filePathOnServer );
	if ($foo->processed) {
		$foo->clean ();
		echo JSON_SUCCESS;
	} else {
		reportErrorAndExit ( $foo->error );
	}
}
Reply

Your reply

Name *
Email 
Title *
Text *
CAPTCHA image
Enter the code displayed on the image:
Click on the image to generate another one if it is hard to read it. The case is important