Warning: Cannot modify header information - headers already sent by...(*my include statement for my database stuff*)
Does anyone have a work around?
Code: Select all
$file = 'http://www.***.net/images/71_1.jpg';
//This will set our output to 45% of the original size
$size = 0.45;
// This sets it to a .jpg, but you can change this to png or gif
header('Content-type: image/jpeg'); //THIS IS WHAT IS CAUSING THE ISSUE
// Setting the resize parameters
list($width, $height) = getimagesize($file);
$modwidth = $width * $size;
$modheight = $height * $size;
// Resizing the Image
$tn = imagecreatetruecolor($modwidth, $modheight);
$image = imagecreatefromjpeg($file);
print_r($image);
imagecopyresampled($tn, $image, 0, 0, 0, 0, $modwidth, $modheight, $width, $height);
// Outputting a .jpg, you can make this gif or png if you want
//notice we set the quality (third value) to 100
imagejpeg($tn, null, 100);