Jump to content

imagejpeg not working ?


Glenskie

Recommended Posts

still nothing :( here is all of my code... 

 

<?php
      //Set the Content Type
      header('Content-type: image/jpeg');
       if (isset($_GET['image'])){
            $picture = $_GET['image'];
            
      // Create Image From Existing File
      $jpg_image = imagecreatefromjpeg("useruploadedphotos/$picture");


      // Allocate A Color For The Text
      $white = imagecolorallocate($jpg_image, 255, 255, 255);


      // Set Path to Font File
      $font_path = 'fonts/Timeless-Bold.ttf';


      // Set Text to Be Printed On Image
      $text = "This is a sunset!";


      // Print Text On Image
      imagettftext($jpg_image, 25, 0, 75, 300, $white, $font_path, $text);


      $directory = "/useruploadedphotos/$picture";


      imagejpeg($jpg_image, "useruploadedphotos/$picture");


      // Clear Memory
      imagedestroy($jpg_image);
}
else{
      die('eror');
}
    ?> 

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.