By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,054 Members | 902 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,054 IT Pros & Developers. It's quick & easy.

GD Rotate returns URL of code. What's that about?

P: 14
I am experimenting with the rotate function and so far I can't get my code to return anything but the URL of my script.
Here it is:

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. // The file you are rotating
  3. $image = 'halloween.jpg';
  4.  
  5. //How many degrees you wish to rotate
  6. $degrees = 180;
  7.  
  8. // This sets the image type to .jpg but can be changed to png or gif
  9. header('Content-type: image/jpeg') ;
  10.  
  11. // Create the canvas
  12. $source = imagecreatefromjpeg($image) ;
  13.  
  14. // Rotates the image
  15. $rotate = imagerotate($source, $degrees, 0) ;
  16.  
  17. // Outputs a jpg image, you could change this to gif or png if needed
  18. imagejpeg($rotate) ;
  19. ?>
All I get back is http://www.website.com/rotate.php
My host is running PHP Version 4.3.10-22 with GD support. The info.php about gd is as follows:
GD Support enabled
GD Version 2.0 or higher
FreeType Support enabled
FreeType Linkage with freetype
T1Lib Support enabled
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled

Is there a work-around if this version of GD does not support rotation of images. By the way, I use GD to resize my images just fine.
Thanks,
Harry
Aug 1 '09 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.