Link to home
Start Free TrialLog in
Avatar of Nottingham
Nottingham

asked on

Rotate Image - Help Please!

This works great! But I need it to do a -90 degree as well.


<?

$img_sorgente="ruotami.jpg";

$size = GetImageSize($img_sorgente);
$tot_x = $size[0];
$tot_y = $size[1];

$img_risulta = ImageCreate ($tot_y,$tot_x)

$img_sorgente=ImageCreateFromJpeg($img_sorgente);

for($i_x=0;$i_x<$tot_x;$i_x++){

        for($i_y=0;$i_y<$tot_y;$i_y++){      

        $ris_x=$tot_y-($i_y+1);
        $ris_y=$i_x;
       
        imagecopy($img_risulta, $img_sorgente,
$ris_x,$ris_y,$i_x,$i_y,1,1);
       

        } // Y

} // X

Imagejpeg($img_risulta);

?>


ASKER CERTIFIED SOLUTION
Avatar of Richard Quadling
Richard Quadling
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Did you ask the question twice?
Did this work?
Avatar of shmert
shmert

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept: rquadling
Please leave any comments here within the next seven days.
               
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
               
Sam Barnum
EE Cleanup Volunteer