InO Posted July 14, 2007 Share Posted July 14, 2007 ok i know this is a noob question but how do i open an image file? i've tried several things and all i get is a blank screen! here's my current experimentation <?php $file = "new-additions/test.jpg"; $im = ImageCreateFromJPEG("new-additions/test.jpg"); ImageJpeg($im,$file); ?> I'm using the GD library and all i need to do is open the file and it's down hill from there Quote Link to comment Share on other sites More sharing options...
Caesar Posted July 14, 2007 Share Posted July 14, 2007 Where's the eader information? Quote Link to comment Share on other sites More sharing options...
Caesar Posted July 14, 2007 Share Posted July 14, 2007 <?php header("Content-Type: image/jpeg"); $file = "new-additions/test.jpg"; $im = ImageCreateFromJPEG($file); imagejpeg($im); ?> Quote Link to comment Share on other sites More sharing options...
InO Posted July 14, 2007 Author Share Posted July 14, 2007 thanks for the reply, with the header and the revised code <?php header("Content-Type: image/jpeg"); $file = "new-additions/test.jpg"; $im = ImageCreateFromJPEG($file); imagejpeg($im); ?> i just get this in the browser http://127.0.0.1:81/mytest/untitled/TMPgzo19l6tka.php Quote Link to comment Share on other sites More sharing options...
Caesar Posted July 14, 2007 Share Posted July 14, 2007 That's your localhost IP...that's not gonna work for anyone else ;-) Quote Link to comment Share on other sites More sharing options...
InO Posted July 14, 2007 Author Share Posted July 14, 2007 any ideas why i can't output an image? 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.