Guest User

Untitled

a guest
Jul 22nd, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. <?php
  2.  
  3. header ("Content-type: image/png");
  4.  
  5. $fileName = $_GET['i'];
  6. /*
  7. if(file_exists(dirname(__FILE__).'/ImageCache/'.$fileName.'.png')){
  8. echo(file_get_contents(dirname(__FILE__).'/ImageCache/'.$fileName.'.png'));
  9. exit;
  10. }
  11. */
  12.  
  13. $img_handle = imagecreatetruecolor(25, 170);
  14.  
  15. $back_color = ImageColorAllocateAlpha($img_handle, 0, 0, 0, 127);
  16.  
  17. $txt_color = ImageColorAllocate($img_handle, 0, 0, 0);
  18.  
  19. ImageFill($img_handle, 0, 0, $back_color);
  20.  
  21. ImageStringUp ($img_handle, 2, 8, 165, $fileName, $txt_color);
  22.  
  23. ImageRotate($img_handle, 180, $back_color);
  24.  
  25. // Output & Save File
  26.  
  27. ImageSaveAlpha($img_handle, true);
  28. ImagePng($img_handle, dirname(__FILE__).'/ImageCache/'.$fileName.'.png');
  29. ImageDestroy($img_handle);
  30. echo(file_get_contents(dirname(__FILE__).'/ImageCache/'.$fileName.'.png'));
  31. ?>
Add Comment
Please, Sign In to add comment