Jump to content

opening an image file


InO

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/59995-opening-an-image-file/
Share on other sites

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

 

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/59995-opening-an-image-file/#findComment-298382
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.