u214 Posted May 1, 2011 Share Posted May 1, 2011 So. I'm using this code right here: <?php $imagepath = "css/images/statspage.jpg"; $image = imagecreatefromjpeg($imagepath); $imgheight = imagesy($image); $color = imagecolorallocate($image, 255, 255, 255); imagestring($image, 5, 70, $imgheight-50, "This is a test", $color); header('Content-Type: image/jpeg'); imagejpeg($image); ?> It works like it should. Now my problem is, is that the image is being displayed at a very low quality! Here's the original image: Here's the image with the code above: RIGHT away you can tell the HUGE difference. I'm not sure what I'm doing wrong. Maybe i need a higher res image? If y'all guys know a different method THAT also achieves the same thing I'm trying to do. Please let me know ASAP! Quote Link to comment Share on other sites More sharing options...
PaulRyan Posted May 1, 2011 Share Posted May 1, 2011 Try using this... <?php $imagepath = "css/images/statspage.jpg"; $image = imagecreatefromjpeg($imagepath); $imgheight = imagesy($image); $color = imagecolorallocate($image, 255, 255, 255); imagestring($image, 5, 70, $imgheight-50, "This is a test", $color); header('Content-Type: image/jpeg'); imagejpeg($image, NULL, 100); ?> Tell me how it goes. Regards, PaulRyan. Quote Link to comment Share on other sites More sharing options...
u214 Posted May 1, 2011 Author Share Posted May 1, 2011 . Very nice. Thank you sooo much man. Works perfectly. I guess I should get into reading more about the PHP function parameters. imagejpeg - Parameters: Image, Filename, QUALITY Thank you so much once again! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.