Reputation: 31
My text wraps great when its rendered in the browser: http://www.morriescontests.com/index.php/view/page/image
But when the same code simply creates and saves a new file it doesn't: http://www.morriescontests.com/images/uploads/32-142.png
This obviously makes me incredibly sad :(
They are separate scripts, one was for testing. The script that doesn't wrap correctly only has one difference, no headers are sent (obvi). I'm using the imgpng($image, $filename) function.
both scripts are on the same server, here is the last line of code:
// create image
header("Content-type: image/png"); // this is omitted from the incorrect wrapping script
// send to browser
imagepng($img); // this is omitted from the incorrect wrapping script
// save to file
$filepath = "the/path/image.png";
imagepng($img, $filepath);
imagedestroy($img);
Upvotes: 1
Views: 111
Reputation: 10880
So did some investigation, you are using the path
to generate the image but the image you were looking at was 32-142.png
so i changed the url to
notice the id=142 and it works ok now. So it seems like the 32-142.png image you were seeing was created previously :)
Upvotes: 1