I'm having an issue with the code below, for some reason I get the following error:
**Warning: imagejpeg() expects parameter 1 to be resource**
Using the following code:
$image = "image1.png";
$output = "filename.jpg";
// Call function
$img = resize_image($image, $output);
function resize_image($file, $output) {
imagejpeg($img, $output, 60);
}
I'm basically trying to pass in the output filename ($output = "filename.jpg";
) into the imagejpeg()
function but getting the above error.