3

I am developing a feature to allow an image to be rotated in increments of 90 degrees or to be flipped horizontally or vertically. I have the code working just fine on my own computer, but when uploaded to a live server, the rotate functionality stops working. The images can still be flipped, but rotating them results in no change at all. There are no error messages. The function that performs the rotation returns the same value as if the rotation was successful. This isn't a case of needing to reload the page (I've tried that). After rotating the image I should be able to find the image file on the server and find that it has indeed been rotated, but that is not happening.

The mind-boggling part of this is that the flipping functionality still works, it's just the rotation functionality that stopped working. Does anyone know if this sort of thing can be caused by something in the server setup? Maybe a different version of the GD2 library? I don't believe that this is a code problem, rather that there's something different about the live server that causes this. Any help would be appreciated.

JGDev
  • 261
  • 1
  • 4
  • 8
  • 1
    Well, first up - check the version like you said; there could be a difference in technique required. Could it be a memory issue? (though that should return an error, are you using @?) – Orbling Feb 11 '11 at 22:12
  • What's the code look like? Remember that imagerotate() makes a new image with the rotated content, leaving the original image handle intact. if you're then going on to save the original image handle, you've basically turned everything into a null-op – Marc B Feb 11 '11 at 22:23
  • 1
    Sounds like a memory issue. An image can be flipped in place, but to rotate you would need to allocate memory for the new image before the rotation occurs. – Roger Halliburton Feb 11 '11 at 23:36

1 Answers1

0

Check out the demo and tutorial at http://www.innovativephp.com/online-image-rotator-using-php-gd-library-for-improving-design-tasks/ for complete details on how to rotate an image with php gd

Rakhitha Nimesh
  • 1,393
  • 2
  • 16
  • 26