[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Rotate Image - Help Please!

Posted on 2002-07-03
13
Medium Priority
?
240 Views
Last Modified: 2012-06-21
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
Comment
Question by:Nottingham
  • 7
  • 6
13 Comments
 

Author Comment

by:Nottingham
ID: 7126464
I need an answer ASAP. So I have increased the points
0
 

Author Comment

by:Nottingham
ID: 7126468
I need an answer ASAP. So I have increased the points
0
 
LVL 6

Expert Comment

by:andreif
ID: 7126579
Try to replace

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

with

$ris_x=$tot_y;
$ris_y=$i_x;
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:Nottingham
ID: 7126586
Nope didn't work - sorry!
0
 
LVL 6

Expert Comment

by:andreif
ID: 7126599
sorry, with

with

$ris_x=$i_y;
$ris_y=$i_x;
0
 

Author Comment

by:Nottingham
ID: 7126604
Nope didn't work - sorry!
0
 

Author Comment

by:Nottingham
ID: 7126607
ignore the last comment
0
 
LVL 6

Expert Comment

by:andreif
ID: 7126611
sorry, with

with

$ris_x=$i_y;
$ris_y=$i_x;
0
 
LVL 6

Expert Comment

by:andreif
ID: 7126614
sorry, I've post duplicate message as you :)
0
 

Author Comment

by:Nottingham
ID: 7126615
Almost there although it seems to rotate 90 then mirror that. Not rotate -90.

Points increased for trying!
0
 
LVL 6

Accepted Solution

by:
andreif earned 2000 total points
ID: 7126712
we are getting closer :)

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

Author Comment

by:Nottingham
ID: 7126833
Well Done!!!! It had me stuck!!

Thanks everso much!

I really appreciate that - you saved me hours!!!
0
 
LVL 6

Expert Comment

by:andreif
ID: 7126851
Thanks!
Could you close duplicate question?

http://www.experts-exchange.com/php/Q_20319032.html
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Suggested Courses
Course of the Month18 days, 23 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question