Copy CodeThe code is as follows:
/**
* Modify a picture to flip the specified degree
*
* @param string $filename file name (including file path)
* @param float $degrees degrees of rotation
* @return Boolean
*/
function Flip ($filename, $src, $degrees = 90)
{
Reading pictures
$data = @getimagesize ($filename);
if ($data ==false) return false;
Reading old pictures
Switch ($data [2]) {
Case 1:
$src _f = imagecreatefromgif ($filename);
Case 2:
$src _f = Imagecreatefromjpeg ($filename);
Case 3:
$src _f = imagecreatefrompng ($filename);
}
if ($src _f== "") return false;
$rotate = @imagerotate ($src _f, $degrees, 0);
if (!imagejpeg ($rotate, $SRC,)) return false;
@imagedestroy ($rotate);
return true;
}
http://www.bkjia.com/PHPjc/825070.html www.bkjia.com true http://www.bkjia.com/PHPjc/825070.html techarticle Copy the code as follows:/** * Modify a picture to flip the specified number of degrees * * @param string $filename file name (including file path) * @param float $degrees Rotation degree * @r ...