Copy code The code is as follows:
/**
* Modify an image to flip the specified degree
*
* @param string $filename file name (including file path)
* @param float $degrees rotation degrees
* @return boolean
*/
function flip($filename,$src,$ degrees = 90)
{
//Read the image
$data = @getimagesize($filename);
if($data==false)return false;
//Read Old image
switch ($data[2]) {
case 1:
$src_f = imagecreatefromgif($filename);break;
case 2:
$src_f = imagecreatefromjpeg($filename );break;
case 3:
$src_f = imagecreatefrompng($filename);break;
}
if($src_f=="")return false;
$rotate = @ imagerotate($src_f, $degrees,0);
if(!imagejpeg($rotate,$src,100))return false;
@imagedestroy($rotate);
return true;
}
http://www.bkjia.com/PHPjc/825070.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/825070.htmlTechArticleCopy the code The code is as follows: /** * Modify an image to flip it by a specified degree* * @param string $filename File name (including file path) * @param float $degrees Rotation degrees * @r...