Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if($_GET['submit']) {
- //Set the Content Type
- header('Content-type: image/jpeg');
- $imgurl = $_GET["imgurl"];//, "memetype", "cap1", "cap1font", "cap2", "cap2font"];
- $memetype = $_GET["memetype"];
- $cap1 = $_GET["cap1"];
- $cap1font = intval($_GET["cap1font"]);
- $cap2 = $_GET["cap2"];
- $cap2font = intval($_GET["cap2font"]);
- // Create file location
- $image_location = '/saved/' . $memetype . '-' . $cap1 . '-' . $cap1font . '-' . $cap2 . '-' . $cap2font . '.jpg';
- echo $image_location;
- $jpg_image = imagecreatefromjpeg($imgurl);
- // Allocate A Color For The Text
- $white = imagecolorallocate($jpg_image, 255, 255, 255);
- // Set Path to Font File
- $font_path = "impact.ttf";
- // Set Text to Be Printed On Image
- $text = $cap1;
- // Print Text On Image
- imagettftext($jpg_image, 25, 0, 75, 300, $white, $font_path, $text);
- // Save Image to generated location
- imagejpeg($jpg_image,$image_location);
- echo '<img src="' . $image_location . '">';
- // Clear Memory
- imagedestroy($jpg_image);
- }
- ?>
Add Comment
Please, Sign In to add comment