imagerotate() help
Posted: Thu Nov 12, 2009 11:37 am
I have searched Google, this forum and several others to no avail, so here is my question:
I am using this code:
But the headers specify that it is an image. I need this rotated image to display in an html page.
I have tried this:
This is without sending headers and it just comes up with showing no image, but the alt comes up. Please help me with this issue.
I am using this code:
Code: Select all
<?php
// The file you are rotating
$image = 'myfile.jpg';
//How many degrees you wish to rotate
$degrees = 270;
// This sets the image type to .jpg but can be changed to png or gif
header('Content-type: image/jpeg') ;
// Create the canvas
$source = imagecreatefromjpeg($image) ;
// Rotates the image
$rotate = imagerotate($source, $degrees, 0) ;
// Outputs a jpg image, you could change this to gif or png if needed
imagejpeg($rotate) ;
?>I have tried this:
Code: Select all
<td><img src='";
//
$image = $row['logo'];
$degrees = 270 ;
$source = imagecreatefromjpeg($image) ;
$rotate = imagerotate($source, $degrees, 0) ;
imagejpeg($rotate) ;
echo "' alt='Jobs' /></td>