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

namespace InterventionImageGd;

class 
Encoder extends InterventionImageAbstractEncoder
{
    
/**
     * Processes and returns encoded image as JPEG string
     *
     * @return string
     */
    
protected function processJpeg()
    {
        
ob_start();
        
imagejpeg($this->image->getCore(), null$this->quality);
        
$this->image->mime image_type_to_mime_type(IMAGETYPE_JPEG);
        
$buffer ob_get_contents();
        
ob_end_clean();

        return 
$buffer;
    }

    
/**
     * Processes and returns encoded image as PNG string
     *
     * @return string
     */
    
protected function processPng()
    {
        
ob_start();
        
$resource $this->image->getCore();
        
imagealphablending($resourcefalse);
        
imagesavealpha($resourcetrue);
        
imagepng($resourcenull, -1);
        
$this->image->mime image_type_to_mime_type(IMAGETYPE_PNG);
        
$buffer ob_get_contents();
        
ob_end_clean();

        return 
$buffer;
    }

    
/**
     * Processes and returns encoded image as GIF string
     *
     * @return string
     */
    
protected function processGif()
    {
        
ob_start();
        
imagegif($this->image->getCore());
        
$this->image->mime image_type_to_mime_type(IMAGETYPE_GIF);
        
$buffer ob_get_contents();
        
ob_end_clean();

        return 
$buffer;
    }

    
/**
     * Processes and returns encoded image as TIFF string
     *
     * @return string
     */
    
protected function processTiff()
    {
        throw new 
InterventionImageExceptionNotSupportedException(
            
"TIFF format is not supported by Gd Driver."
        
);
    }

    
/**
     * Processes and returns encoded image as BMP string
     *
     * @return string
     */
    
protected function processBmp()
    {
        throw new 
InterventionImageExceptionNotSupportedException(
            
"BMP format is not supported by Gd Driver."
        
);
    }

    
/**
     * Processes and returns encoded image as ICO string
     *
     * @return string
     */
    
protected function processIco()
    {
        throw new 
InterventionImageExceptionNotSupportedException(
            
"ICO format is not supported by Gd Driver."
        
);
    }

    
/**
     * Processes and returns encoded image as PSD string
     *
     * @return string
     */
    
protected function processPsd()
    {
        throw new 
InterventionImageExceptionNotSupportedException(
            
"PSD format is not supported by Gd Driver."
        
);
    }
}
Онлайн: 0
Реклама