Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function rotate_image($stupen,$file){
- $size = getimagesize($file);
- if($size[2] == IMAGETYPE_PNG){
- $im = imagecreatefrompng($file);
- $white = imagecolorallocate($im, 255, 255, 255);
- $im = imagerotate($im, $stupen, $white);
- imagepng($im, $file, 100);
- }
- if($size[2] == IMAGETYPE_JPEG){
- $im = imagecreatefromjpeg($file);
- $white = imagecolorallocate($im, 255, 255, 255);
- $im = imagerotate($im, $stupen, $white);
- imagejpeg($im, $file, 100);
- }
- }
Add Comment
Please, Sign In to add comment