PHP / MySQL

  1. Home
  2. Computing & Technology
  3. PHP / MySQL
photo of Angela Bradley

Angela's PHP / MySQL Blog

By Angela Bradley, About.com Guide to PHP / MySQL

Rotate an Image

Monday October 30, 2006

You can use the GD Library with PHP to do many things with graphics. This script shows you how to rotate an image using PHP. Here we have rotated an image 180 degrees, however you can rotate by any degree value you want.

Comments

May 17, 2007 at 11:20 pm
(1) Nutt says:

Call to undefined function imagerotate()
Somebody help me!
Why this function not work?
Nutt~Thailand

November 14, 2007 at 4:45 am
(2) Robin Pietersen says:

Hi Angela

Thanks for the script! I used it a while ago on a project - perfect.

I’ve added a version to my blog, it has a demo and people can download the source.

It’s basicly the same image rotation script, I simple prettied it up.

Once again - Thanks!!!!!

April 17, 2009 at 12:21 am
(3) Martin says:

I tried using this on my website and it does not seem to work right it ads in black space to the one side and cuts off other parts of the image. I think its not creating the canvas at the right dimensions before rotating.

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

Discuss

Community Forum

Explore PHP / MySQL

About.com Special Features

PHP / MySQL

  1. Home
  2. Computing & Technology
  3. PHP / MySQL

©2009 About.com, a part of The New York Times Company.

All rights reserved.