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);

?>


NottinghamAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
andreifConnect With a Mentor Commented:
we are getting closer :)

$ris_x=$i_y;
$ris_y=$tot_x-($i_x+1);
0
 
NottinghamAuthor Commented:
I need an answer ASAP. So I have increased the points
0
 
NottinghamAuthor Commented:
I need an answer ASAP. So I have increased the points
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
andreifCommented:
Try to replace

$ris_x=$tot_y-($i_y+1);
$ris_y=$i_x;

with

$ris_x=$tot_y;
$ris_y=$i_x;
0
 
NottinghamAuthor Commented:
Nope didn't work - sorry!
0
 
andreifCommented:
sorry, with

with

$ris_x=$i_y;
$ris_y=$i_x;
0
 
NottinghamAuthor Commented:
Nope didn't work - sorry!
0
 
NottinghamAuthor Commented:
ignore the last comment
0
 
andreifCommented:
sorry, with

with

$ris_x=$i_y;
$ris_y=$i_x;
0
 
andreifCommented:
sorry, I've post duplicate message as you :)
0
 
NottinghamAuthor Commented:
Almost there although it seems to rotate 90 then mirror that. Not rotate -90.

Points increased for trying!
0
 
NottinghamAuthor Commented:
Well Done!!!! It had me stuck!!

Thanks everso much!

I really appreciate that - you saved me hours!!!
0
 
andreifCommented:
Thanks!
Could you close duplicate question?

http://www.experts-exchange.com/php/Q_20319032.html
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.