PHP Class Gdn_UploadImage, vanilla

Inheritance: extends Gdn_Upload
Show file Open project: vanilla/vanilla Class Usage Examples

Public Methods

Method Description
canUploadImages ( ) : boolean Check that we have the necessary tools to allow image uploading.
clear ( )
imageIco ( $gd, $targetPath )
imageSize ( string $Path, string $Filename = false ) : array Gets the image size of a file.
saveImageAs ( $Source, $Target, $Height = '', $Width = '', $Options = [] ) Saves the specified image at $Target in the specified format with the specified dimensions (or the existing dimensions if height/width are not provided.
validateUpload ( $InputName, $ThrowError = true ) Validates the uploaded image. Returns the temporary name of the uploaded file.

Method Details

canUploadImages() public static method

Check that we have the necessary tools to allow image uploading.
public static canUploadImages ( ) : boolean
return boolean

clear() public method

public clear ( )

imageIco() public static method

public static imageIco ( $gd, $targetPath )

imageSize() public static method

Gets the image size of a file.
Since: 2.1
public static imageSize ( string $Path, string $Filename = false ) : array
$Path string The path to the file.
$Filename string The name of the file.
return array An array of [width, height, image type].

saveImageAs() public static method

Saves the specified image at $Target in the specified format with the specified dimensions (or the existing dimensions if height/width are not provided.
public static saveImageAs ( $Source, $Target, $Height = '', $Width = '', $Options = [] )

validateUpload() public method

Validates the uploaded image. Returns the temporary name of the uploaded file.
public validateUpload ( $InputName, $ThrowError = true )