Вход Регистрация
Файл: gapps/vendor/intervention/image/src/Intervention/Image/Gd/Commands/BackupCommand.php
Строк: 39
<?php

namespace InterventionImageGdCommands;

class 
BackupCommand extends InterventionImageCommandsAbstractCommand
{
    
/**
     * Saves a backups of current state of image core
     *
     * @param  InterventionImageImage $image
     * @return boolean
     */
    
public function execute($image)
    {
        
$backupName $this->argument(0)->value();

        
// clone current image resource
        
$size $image->getSize();
        
$clone imagecreatetruecolor($size->width$size->height);
        
imagealphablending($clonefalse);
        
imagesavealpha($clonetrue);
        
$transparency imagecolorallocatealpha($clone000127);
        
imagefill($clone00$transparency);

        
// copy image to clone
        
imagecopy($clone$image->getCore(), 0000$size->width$size->height);

        
$image->setBackup($clone$backupName);

        return 
true;
    }
}
Онлайн: 0
Реклама