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

declare(strict_types=1);

namespace 
InterventionImageDriversImagickModifiers;

use 
InterventionImageExceptionsNotSupportedException;
use 
InterventionImageInterfacesImageInterface;
use 
InterventionImageInterfacesSpecializedInterface;
use 
InterventionImageModifiersTrimModifier as GenericTrimModifier;

class 
TrimModifier extends GenericTrimModifier implements SpecializedInterface
{
    public function 
apply(ImageInterface $image): ImageInterface
    
{
        if (
$image->isAnimated()) {
            throw new 
NotSupportedException('Trim modifier cannot be applied to animated images.');
        }

        
$imagick $image->core()->native();
        
$imagick->trimImage(($this->tolerance 100 $imagick->getQuantum()) / 1.5);
        
$imagick->setImagePage(0000);

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