0
votes

imagerotate() function is not working for me. See the code below

    $source = imagecreatefromjpeg($filename);

    // Rotate
    $source = imagerotate($source, 90, 0);

    // Output
    imagejpeg($source);

    // Free the memory
    imagedestroy($source);

This is what is get from phpinfo regarding gd

GD Support enabled GD Version bundled (2.1.0 compatible) FreeType

Support enabled FreeType Linkage with freetype FreeType Version

2.3.11 GIF Read Support enabled GIF Create Support enabled JPEG Support enabled libJPEG Version 6b PNG Support enabled libPNG

Version 1.2.49 WBMP Support enabled XPM Support enabled libXpm

Version 30411 XBM Support enabled

I searched a lot for the answer, but didn't get the correct answer for this.

can any suggest a solution for this? any help will be appreciated

1
Have you tried another jpg file? Code works for me. Maybe you forgot the headers? header("Content-Type: image/jpeg"); - Joachim
Works for me too. What does 'not working' mean? How do you know it's not working? Does the image render, just not rotated? Do you get a blank page? Make sure you've enabled all error reporting and check the PHP error log. - timclutton

1 Answers

0
votes

Thanks to all who replied to my question.

It was actually working. It was not working for me because of an error generated, which prevented the execution imagerotate function.

Thanks once again.