ExtractedImage
    
            
            in package
            
        
    
    
    
An extracted sub-image.
Table of Contents
Properties
- $filename : string
- Name of the file.
- $image : Imagick
- Imagick wrapper for the image.
- $saveFormat : string
- String representation of the save format.
Methods
- __construct() : mixed
- Initializes a new instance of the ExtractedImage class.
- asInputSource() : BytesInput
- Returns the image in a format suitable for sending to a client for parsing.
- writeToFile() : void
- Writes the image to a file.
- getEncodedImageFormat() : string
- Get the encoded image format.
Properties
$filename
Name of the file.
        public
            string
    $filename
    
    
    
    
    
    
$image
Imagick wrapper for the image.
        public
            Imagick
    $image
    
    
    
    
    
    
$saveFormat
String representation of the save format.
        protected
            string
    $saveFormat
    
    
    
    
    
    
Methods
__construct()
Initializes a new instance of the ExtractedImage class.
    public
                    __construct(mixed $image, string $filename, string $saveFormat) : mixed
    Parameters
- $image : mixed
- 
                    The extracted image. Not explicitly typed as \Imagick to avoid errors. 
- $filename : string
- 
                    The filename for the image. 
- $saveFormat : string
- 
                    The format to save the image. 
Tags
asInputSource()
Returns the image in a format suitable for sending to a client for parsing.
    public
                    asInputSource() : BytesInput
    Tags
Return values
BytesInput —Bytes input for the image.
writeToFile()
Writes the image to a file.
    public
                    writeToFile(string $outputPath) : void
    Uses the default image format and filename.
Parameters
- $outputPath : string
- 
                    The output directory (must exist). 
Tags
getEncodedImageFormat()
Get the encoded image format.
    private
                    getEncodedImageFormat(string $saveFormat) : string
    Parameters
- $saveFormat : string
- 
                    Format to save the file as.