CKFinder 3 – PHP Connector Documentation
ResizedImage Class Reference
Inheritance diagram for ResizedImage:
ResizedImageAbstract

Public Member Functions

 __construct (ResizedImageRepository $resizedImageRepository, ResourceType $sourceFileResourceType, $sourceFileDir, $sourceFileName, $requestedWidth, $requestedHeight, $forceRequestedSize=false)
 
 getDirectory ()
 
 create ()
 
 getUrl ()
 
 requestedSizeIsValid ()
 
- Public Member Functions inherited from ResizedImageAbstract
 __construct (ResourceType $sourceFileResourceType, string $sourceFileDir, string $sourceFileName, int $requestedWidth, int $requestedHeight)
 
 getResourceType ()
 
 getFileName ()
 
 getFilePath ()
 
 getMimeType ()
 
 getTimestamp ()
 
 getSize ()
 
 getImageData ()
 
 setImageData ($imageData)
 
 exists ()
 
 save ()
 
 load ()
 
 readStream ()
 
 create ()
 
 getDirectory ()
 

Static Public Member Functions

static createFilename ($fileName, $width, $height)
 
static getSizeFromFilename ($resizedImageFileName)
 

Public Attributes

const DIR = '__thumbs'
 

Protected Attributes

 $resizedImageRepository
 
 $image
 
 $width
 
 $height
 
 $requestedSizeIsValid = true
 
 $sourceFileDir
 
- Protected Attributes inherited from ResizedImageAbstract
 $sourceFileResourceType
 
 $backend
 
 $sourceFileDir
 
 $sourceFileName
 
 $requestedWidth
 
 $requestedHeight
 
 $resizedImageFileName
 
 $resizedImageData
 
 $resizedImageSize
 
 $resizedImageMimeType
 
 $timestamp
 
ExtensionMimeTypeDetector $mimeTypeDetector
 

Detailed Description

The resized image class.

A class representing an image that was resized to given dimensions.

Constructor & Destructor Documentation

◆ __construct()

__construct ( ResizedImageRepository  $resizedImageRepository,
ResourceType  $sourceFileResourceType,
  $sourceFileDir,
  $sourceFileName,
  $requestedWidth,
  $requestedHeight,
  $forceRequestedSize = false 
)
Parameters
ResizedImageRepository$resizedImageRepositoryResized image repository object
ResourceType$sourceFileResourceTypeSource image file resource type
string$sourceFileDirResource type relative directory path
string$sourceFileNameSource image filename
int$requestedWidthRequested width
int$requestedHeightRequested height
bool$forceRequestedSizeA flag telling if the requested size should be used, without calculating the aspect ratio
Exceptions

Exception if the source image is invalid

Member Function Documentation

◆ create()

create ( )

Creates a resized image.

Reimplemented from ResizedImageAbstract.

◆ getDirectory()

getDirectory ( )

Returns the directory of the resized image.

Returns
string

Reimplemented from ResizedImageAbstract.

◆ getUrl()

getUrl ( )

Returns the direct URL to the resized image.

Returns
string

◆ requestedSizeIsValid()

requestedSizeIsValid ( )

Checks if the size requested for the resized image is valid.

Returns
bool true if the requested size is valid

The documentation for this class was generated from the following file: