View file www/ipg.php

File size: 1.64Kb
<?php
#-----------------------------------------------------#
#          ********* Бизнес Сайты *********           #
#             Made by   :  BIZON                      #
#               E-mail  :  [email protected]            #
#                 Site  :  http://f913218p.bget.ru    #
#  Вы не имеете право вносить изменения в код скрипта #
#      это может повлечь неработоспособность сайта    #
#-----------------------------------------------------#
if(isset($_GET['url'])&& isset($_GET['w']) && isset($_GET['h'])){
$st = htmlspecialchars($_GET['url']);
$st = stripslashes(trim($st));
$width=(int)($_GET['w']);
$height=(int)($_GET['h']);
$filename = $st;
$type = getimagesize($filename);
switch ($type['mime']) {
         case "image/jpeg":
         $fi=$filename;
         header('Content-Type: image/jpeg');
         $image = imageCreateFromJPEG($filename);
         break;

         case "image/gif":
         $fi=$filename;
         header('Content-Type: image/gif');
         $image = imageCreateFromGIF($filename);
         break;

         case "image/png":
         $fi=$filename;
         header('Content-Type: image/png');
         $image = imageCreateFromPNG($filename);
         break;

         default:
         }
list($width_orig, $height_orig) = getimagesize($fi);
$image_p = imagecreatetruecolor($width, $height);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
switch ($type['mime']) {
      case "image/jpeg":
      imagejpeg($image_p);
      break;

      case "image/gif":
      imagegif($image_p);
      break;

      case "image/png":
      imagepng($image_p);
      break;

      default:
      }
}
?>