Вход Регистрация
Файл: vendor/intervention/image/src/Drivers/Gd/Modifiers/ResizeCanvasModifier.php
Строк: 36
<?php

declare(strict_types=1);

namespace 
InterventionImageDriversGdModifiers;

use 
InterventionImageInterfacesImageInterface;
use 
InterventionImageInterfacesSpecializedInterface;
use 
InterventionImageModifiersResizeCanvasModifier as GenericResizeCanvasModifier;

class 
ResizeCanvasModifier extends GenericResizeCanvasModifier implements SpecializedInterface
{
    
/**
     * {@inheritdoc}
     *
     * @see ModifierInterface::apply()
     */
    
public function apply(ImageInterface $image): ImageInterface
    
{
        
$cropSize $this->cropSize($image);

        
$image->modify(new CropModifier(
            
$cropSize->width(),
            
$cropSize->height(),
            
$cropSize->pivot()->x(),
            
$cropSize->pivot()->y(),
            
$this->background,
        ));

        return 
$image;
    }
}
Онлайн: 3
Реклама