Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Demotivators rendering script
- * Copyright (c) by Fenek
- * For Eris-Chan (http://www.erischan.pl/)
- */
- header("Content-type: image/png"); // Informacja dla przeglądarki, że jest to obraz
- $Title = $_GET['title']; // Sprawdzenie poprawności tytułu
- $Description = $_GET['description']; // Sprawdzenie poprawności opisu
- $Image = imagecreatetruecolor(750, 600); // Stworzenie obrazka 750*600 px
- $AlterImage = imagecreatefromjpeg($_GET['img']);
- $Background = imagecolorallocate($Image, 0, 0, 0); // Kolor tła; czarny
- $White = imagecolorallocate($Image, 255, 255, 255); // Kolor tekstu; biały
- $Footer[0] = imagecolorallocate($Image, 128, 128, 128); // Kolor tekstu; szary
- $Footer[1] = imageloadfont('erischan.pl.gdf'); // Wczytanie czcionki dla stopki
- $Fonts = array('Times_New_Roman.ttf', 'Arial.ttf', 'Verdana.ttf', 'Tahoma.ttf');
- imagefill($Image, 0, 0, $Background); // Wypełnij kolorem czarnym zaczynając od punktu 0,0
- imagefilledrectangle($Image, 70, 45, 680, 455, $White); // Stwórz prostokąt zaczynając od punktu 70,45, a kończąc w punkcie 680,455 i wypełnij go kolorem białym
- imagefilledrectangle($Image, 72, 47, 678, 453, $Background);
- imagestring($Image, $Footer[1], 660, 585, 'erischan.pl', $Footer[0]); // Wypisz stopkę
- imagestring($Image, $Footer[1], 10, 585, 'Copyright (c) by Fenek', $Footer[0]);
- imagettftext($Image, 46, 0, 200, 510, $White, $Fonts[0], $Title); // Wypisz tytuł używając określonej czcionki
- imagettftext($Image, 16, 0, 100, 555, $White, $Fonts[1], $Description);
- imagecopy($Image, $AlterImage, 72, 47, 0, 0, 606, 406);
- imagepng($Image);
- imagedestroy($Image);
- imagedestroy($AlterImage);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment