Solved

# Rotate Image - Help Please!

Posted on 2002-07-03
212 Views
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
Question by:Nottingham
• 3

LVL 40

Accepted Solution

ID: 7126864
Try ...

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

as the transform.

0

LVL 40

Expert Comment

ID: 7126870
Did you ask the question twice?
0

LVL 40

Expert Comment

ID: 7131643
Did this work?
0

LVL 11

Expert Comment

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:

Sam Barnum
EE Cleanup Volunteer
0

## Featured Post

### Suggested Solutions

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.