Guest User

Untitled

a guest
Jul 21st, 2018
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. <?php
  2.  
  3. $destination = $_GET['route'];
  4.  
  5. if (eregi("^(.+)-iphone\.(.+)$",$destination,$r)) {
  6.  
  7. header("Content-type: image/".$r[2]);
  8.  
  9. $original = $r[1].".".$r[2];
  10.  
  11. if (file_exists($original) && !eregi("iphone-gui\.png$",$original)) {
  12.  
  13. $or = new Imagick($original);
  14. $or->setCompression(Imagick::FILTER_LANCZOS);
  15. $or->ThumbnailImage(160,240,true);
  16.  
  17. $im = new Imagick(dirname(__FILE__).'/iphone-gui.png');
  18. $im->compositeImage($or,Imagick::COMPOSITE_DEFAULT,18,60);
  19.  
  20. $im->writeImage($destination);
  21.  
  22. echo file_get_contents($destination);
  23.  
  24. }
  25.  
  26. }
  27.  
  28. header("HTTP/1.0 404 Not Found");
  29.  
  30. ?>
Add Comment
Please, Sign In to add comment