!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)

/var/www/html/dokan/script/vendor/intervention/image/src/Intervention/Image/Imagick/Commands/   drwxrwxrwx
Free 13.16 GB of 57.97 GB (22.7%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     MaskCommand.php (1.89 KB)      -rwxrwxrwx
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace Intervention\Image\Imagick\Commands;

use 
Intervention\Image\Commands\AbstractCommand;

class 
MaskCommand extends AbstractCommand
{
    
/**
     * Applies an alpha mask to an image
     *
     * @param  \Intervention\Image\Image $image
     * @return boolean
     */
    
public function execute($image)
    {
        
$mask_source $this->argument(0)->value();
        
$mask_w_alpha $this->argument(1)->type('bool')->value(false);

        
// get imagick
        
$imagick $image->getCore();

        
// build mask image from source
        
$mask $image->getDriver()->init($mask_source);

        
// resize mask to size of current image (if necessary)
        
$image_size $image->getSize();
        if (
$mask->getSize() != $image_size) {
            
$mask->resize($image_size->width$image_size->height);
        }

        
$imagick->setImageMatte(true);

        if (
$mask_w_alpha) {

            
// just mask with alpha map
            
$imagick->compositeImage($mask->getCore(), \Imagick::COMPOSITE_DSTIN00);

        } else {

            
// get alpha channel of original as greyscale image
            
$original_alpha = clone $imagick;
            
$original_alpha->separateImageChannel(\Imagick::CHANNEL_ALPHA);

            
// use red channel from mask ask alpha
            
$mask_alpha = clone $mask->getCore();
            
$mask_alpha->compositeImage($mask->getCore(), \Imagick::COMPOSITE_DEFAULT00);
            
// $mask_alpha->setImageAlphaChannel(\Imagick::ALPHACHANNEL_DEACTIVATE);
            
$mask_alpha->separateImageChannel(\Imagick::CHANNEL_ALL);

            
// combine both alphas from original and mask
            
$original_alpha->compositeImage($mask_alpha\Imagick::COMPOSITE_COPYOPACITY00);

            
// mask the image with the alpha combination
            
$imagick->compositeImage($original_alpha\Imagick::COMPOSITE_DSTIN00);
        }

        return 
true;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

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

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