PHP image shrinking function. After the original image is deleted and the operated image is retained, the *** image reduction function * @ paramstring $ fileName * @ returnvoid * privatefunctioncreateSmallImg ($ fileName) {list ($ width, $ heigh deleted the original image and retained the image after the operation.
/**
* Function for downgrading images
* @ Param string $ fileName
* @ Return void
*/
Private function createSmallImg ($ fileName)
{
List ($ width, $ height, $ type, $ attr) = getimagesize ($ fileName );
$ ImgOld = imagecreatefromjpeg ($ fileName );
$ ImgObj = imagecreatetruecolor ($ width-100, $ height-100 );
If (function_exists ('imagecopyresampled '))
{
Imagecopyresampled ($ imgObj, $ imgOld, 100, 100, $ width-, $ height-, imagesx ($ imgOld), imagesy ($ imgOld ));
}
Else
{
Imagecopyresized ($ imgObj, $ imgOld, 100, 100, $ width-, $ height-, imagesx ($ imgOld), imagesy ($ imgOld ));
}
Imagedestroy ($ imgOld );
Unlink ($ fileName );
Imagejpeg ($ imgObj, $ fileName, 100 );
Chmod ($ fileName, 0777 );
Imagedestroy ($ imgObj );
Functions/*** zoom out function * @ param string $ fileName * @ return void */private function createSmallImg ($ fileName) {list ($ width, $ heigh...