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

declare(strict_types=1);

namespace 
InterventionImageDriversImagickDecoders;

use 
InterventionImageExceptionsDecoderException;
use 
InterventionImageInterfacesColorInterface;
use 
InterventionImageInterfacesImageInterface;

class 
FilePointerImageDecoder extends BinaryImageDecoder
{
    
/**
     * {@inheritdoc}
     *
     * @see DecoderInterface::decode()
     */
    
public function decode(mixed $input): ImageInterface|ColorInterface
    
{
        if (!
is_resource($input) || !in_array(get_resource_type($input), ['file''stream'])) {
            throw new 
DecoderException('Unable to decode input');
        }

        
$contents '';
        @
rewind($input);
        while (!
feof($input)) {
            
$contents .= fread($input1024);
        }

        return 
parent::decode($contents);
    }
}
Онлайн: 2
Реклама