hi,

I need php mysql image upload and resizer.
The image uploaded through a uploading page should be resized and should kept in mysql server. and we need to retrieve it to another page. help me.

thanks,

hi,

I need php mysql image upload and resizer.
The image uploaded through a uploading page should be resized and should kept in mysql server. and we need to retrieve it to another page. help me.

thanks,

This link shows most of what you need

http://www.webmotionuk.co.uk/php-jquery-image-upload-and-crop-v11/

for the demo

http://www.webmotionuk.co.uk/jquery/image_upload_crop.php

the code doesn't use any database but it does have a nice function about resizing images.

//sample from the code linked above
function resizeImage($image,$width,$height,$scale) {
	list($imagewidth, $imageheight, $imageType) = getimagesize($image);
	$imageType = image_type_to_mime_type($imageType);
	$newImageWidth = ceil($width * $scale);
	$newImageHeight = ceil($height * $scale);
	$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);
	switch($imageType) {
		case "image/gif":
			$source=imagecreatefromgif($image); 
			break;
	    case "image/pjpeg":
		case "image/jpeg":
		case "image/jpg":
			$source=imagecreatefromjpeg($image); 
			break;
	    case "image/png":
		case "image/x-png":
			$source=imagecreatefrompng($image); 
			break;
  	}
	imagecopyresampled($newImage,$source,0,0,0,0,$newImageWidth,$newImageHeight,$width,$height);
	
	switch($imageType) {
		case "image/gif":
	  		imagegif($newImage,$image); 
			break;
      	case "image/pjpeg":
		case "image/jpeg":
		case "image/jpg":
	  		imagejpeg($newImage,$image,90); 
			break;
		case "image/png":
		case "image/x-png":
			imagepng($newImage,$image);  
			break;
    }
	
	chmod($image, 0777);
	return $image;
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.