Home » » imagerotate

imagerotate

Written By 1 on Sunday, September 30, 2012 | 7:18 PM

resource imagerotate ( resource $image , float $angle , int $bgd_color [, int $ignore_transparent = 0 ] )

Rotate an image with a given angle

Rotates the image image using the given angle in degrees.


<?php
// File and rotation
$filename = 'test.jpg';
$degrees = 180;

// Content type
header('Content-type: image/jpeg');

// Load
$source = imagecreatefromjpeg($filename);

// Rotate
$rotate = imagerotate($source, $degrees, 0);

// Output
imagejpeg($rotate);
?>

5.1.0 ignore_transparent was added.


web site by WordPress: images and other media

0 Comment:

Post a Comment