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

declare(strict_types=1);

namespace 
InterventionImageDriversGdModifiers;

use 
InterventionImageColorsRgbColorspace as RgbColorspace;
use 
InterventionImageExceptionsNotSupportedException;
use 
InterventionImageInterfacesImageInterface;
use 
InterventionImageInterfacesSpecializedInterface;
use 
InterventionImageModifiersColorspaceModifier as GenericColorspaceModifier;

class 
ColorspaceModifier extends GenericColorspaceModifier implements SpecializedInterface
{
    
/**
     * {@inheritdoc}
     *
     * @see ModifierInterface::apply()
     */
    
public function apply(ImageInterface $image): ImageInterface
    
{
        if (!(
$this->targetColorspace() instanceof RgbColorspace)) {
            throw new 
NotSupportedException(
                
'Only RGB colorspace is supported by GD driver.'
            
);
        }

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