-6

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?

Community
  • 1
  • 1
DEVOPS
  • 18,190
  • 34
  • 95
  • 118
  • 1
    You've already had 6 answers to your original question on resizing images http://stackoverflow.com/questions/3004971/how-to-resize-an-image-using-php so what have you done so far? – Mark Baker Jun 09 '10 at 10:57
  • I am sorry for the previous post. – DEVOPS Jun 09 '10 at 11:12

1 Answers1

2

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

zaf
  • 22,776
  • 12
  • 65
  • 95
  • $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); it does'nt out put any thing why? – DEVOPS Jun 10 '10 at 06:04
  • 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 Jun 10 '10 at 06:43