How to reduce image file size while uploading server in php code?
my question how to reduce file size? examble 2mb convert 1mb
Date :
2013-12-20 16:10:12
By :
vishwa
$width=200;
$size=GetimageSize($images);
$height=round($width*$size[1]/$size[0]);
$images_orig = ImageCreateFromJPEG($images);
$photoX = ImagesX($images_orig);
$photoY = ImagesY($images_orig);
$images_fin = ImageCreateTrueColor($width, $height);
ImageCopyResampled($images_fin, $images_orig, 0, 0, 0, 0, $width+1, $height+1, $photoX, $photoY);
ImageJPEG($images_fin,"myfile/".$new_images);
ImageDestroy($images_orig);
ImageDestroy($images_fin);
Date :
2013-12-20 17:26:10
By :
apisitp
Thanks
Date :
2013-12-20 18:01:31
By :
vishwa
Thanks
Date :
2013-12-23 10:45:20
By :
vishwa
I wonder whether you want to compress the image file's size or just want to change image size">change image size ? Have you ever tried to deal with it using some 3rd party toolkits? Any other suggestion?
Date :
2014-04-10 09:47:45
By :
arronlee
Load balance : Server 04