• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 241
  • Last Modified:

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

?>


0
Nottingham
Asked:
Nottingham
  • 7
  • 6
1 Solution
 
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
 
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
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 
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
 
andreifCommented:
we are getting closer :)

$ris_x=$i_y;
$ris_y=$tot_x-($i_x+1);
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

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 7
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now