#overlay "1011197735591770"); $id= $r['id']; $path = "cache/".$id.".jpg"; <<<<<<< HEAD $_SESSION['path']=$path; ======= $_SESSION['path'] = $path; >>>>>>> update // only create if not already exists in cache if (!file_exists($path)){ create($id, $path); } else{ echo " \n already exitst : ".$path; } //override line 13. Always create for testing purposes //create($id, $path); //output as jpeg //header('Content-Type: image/jpg'); //readfile($path); //upload($path,$token,$fb); // HttpRequest for user profile image function curly($token){ // create curl resource $ch = curl_init(); // set url curl_setopt($ch, CURLOPT_URL, "https://graph.facebook.com/me?access_token=".$token); //return the transfer as a string curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // $output contains the output string $output = curl_exec($ch); // close curl resource to free up system resources curl_close($ch); return $output; } // Create image function create($id, $path){ // base image is just a transparent png in the same size as the input image $base_image = imagecreatefrompng("images/template320.png"); // Get the facebook profile image in 200x200 pixels $photo = imagecreatefromjpeg("http://graph.facebook.com/".$id."/picture?width=320&height=320"); //$photo = imagecreatefromjpeg("http://graph.facebook.com/".$id."/picture?width=200&height=200"); //resizeImage($photo,920,920); // read overlay $overlay = imagecreatefrompng("images/overlay320n.png"); // keep transparency of base image imagesavealpha($base_image, true); imagealphablending($base_image, true); // place photo onto base (reading all of the photo and pasting unto all of the base) imagecopyresampled($base_image, $photo, 0, 0, 0, 0, 320, 320, 320, 320); // place overlay on top of base and photo imagecopy($base_image, $overlay, 0, 0, 0, 0, 320, 320); // Save as jpeg imagejpeg($base_image, $path); } <<<<<<< HEAD ======= >>>>>>> update ?> Show your support for Net Neutralty | Update class="bg">
<<<<<<< HEAD

Your new profile picture is ready !

=======

You new profile picture is ready !

>>>>>>> update alt="">

<<<<<<< HEAD
=======
>>>>>>> update Spread the word: