tags:

views:

56

answers:

1

Possible Duplicate:
How to resize an image using PHP?

Here's what I've tried:

$image = "images/20100609124341Chrysanthemum.jpg"; 
$degrees = 40; 
// Content type 
header('Content-type: image/jpeg'); 
// Load 
$source = imagecreatefromjpeg($filename);
// Rotate 
$rotate = imagerotate($source, $degrees, 0);
// Output 
imagejpeg($rotate); 

...But I get no output. Can anyone tell me what's wrong with this?

+1  A: 

Using the image rotate function: http://php.net/manual/en/function.imagerotate.php

zaf
$image = "images/20100609124341Chrysanthemum.jpg";$degrees = 40;// Content typeheader('Content-type: image/jpeg');// Load$source = imagecreatefromjpeg($filename);// Rotate$rotate = imagerotate($source, $degrees, 0);// Outputimagejpeg($rotate);it does'nt out put any thing why?
learner
First use "error_reporting(-1);" and then try without the header() function and see what error you are getting. You have to make sure the image is being loaded first and then you rotate and output.
zaf