Solved

Rotate Image - Help Please!

Posted on 2002-07-03
6
212 Views
Last Modified: 2011-10-03
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
  • 3
6 Comments
 
LVL 40

Accepted Solution

by:
RQuadling earned 200 total points
ID: 7126864
Try ...

          $ris_x=$i_y;
          $ris_y=$tot_x - $i_x - 1;

as the transform.

0
 
LVL 40

Expert Comment

by:RQuadling
ID: 7126870
Did you ask the question twice?
0
 
LVL 40

Expert Comment

by:RQuadling
ID: 7131643
Did this work?
0
 
LVL 11

Expert Comment

by:shmert
ID: 9643727
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              
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
php image upload 3 27
update field on focusout 15 24
php variable basic question 12 29
File not deleting using unlink 6 13
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now