Class ImageUploader

Description

Implements interfaces:

FileUploader is a class that allows for easy implementation for uploading multiple image or audio files at once.

This class may also upload a single image from a URL

  • author: Michael Dahlke

Located in /classes/ImageUploader.class.php (line 16)

FileUploader
   |
   --ImageUploader
Direct descendents
Class Description
 class UploadImage FileUploader is a class that allows for easy implementation for uploading multiple image or audio files at once.
Class Constant Summary
 GIF = 'gif'
 JPG = 'jpg'
 PNG = 'png'
Variable Summary
Method Summary
 string createUploadingDirectory (string $input)
 string echoAllFileNames ()
 string echoAllPathNames ()
 void getFileNameFull ()
 string getFileNameFullAtIndex (int $index)
 string getFileNameSmallAtIndex (int $index)
 string getFileNameThumbAtIndex (int $index)
 void getFilePathFull ()
 string getFilePathFullAtIndex (int $index)
 string getFilePathSmallAtIndex (int $index)
 string getFilePathThumbAtIndex (int $index)
 void getFullImageQuality ( $imageType)
 void getSmallImageQuality ( $imageType)
 void getThumbImageQuality ( $imageType)
 void keepImageTransparency (string $image)
 string returnMysqlQuery ()
 void setFileNameFull ( $input)
 void setFileNameSmall ( $input)
 void setFileNameThumb ( $input)
 void setFilePathFull ( $input)
 void setFilePathSmall ( $input)
 void setFilePathThumb ( $input)
 void setFullImageQuality ( $input)
 void setOriginalFilePath ( $input)
 void setSmallImageHeight ( $input)
 void setSmallImageQuality ( $input)
 void setSmallImageWidth ( $input)
 void setSmallImageWidthAndHeight (int $w, int $h)
 void setThumbImageHeight ( $input)
 void setThumbImageQuality ( $input)
 void setThumbImageWidth ( $input)
 void setThumbImageWidthAndHeight (int $w, int $h)
Variables
static mixed $allowGIFImages = true (line 35)
  • access: protected
mixed $fileNameFull = array() (line 17)
  • access: protected
mixed $fileNameSmall = array() (line 18)
  • access: protected
mixed $fileNameThumb = array() (line 19)
  • access: protected
mixed $filePathFull = array() (line 20)
  • access: protected
mixed $filePathSmall = array() (line 21)
  • access: protected
mixed $filePathThumb = array() (line 22)
  • access: protected
mixed $fileTypeForUpload = 'image' (line 32)
  • access: protected

Redefinition of:
FileUploader::$fileTypeForUpload
mixed $fullImageQuality = 90 (line 28)
  • access: protected
mixed $inParentDirectory = false (line 23)
  • access: protected
mixed $smallImageHeight = 500 (line 25)
  • access: protected
mixed $smallImageQuality = 75 (line 29)
  • access: protected
mixed $smallImageWidth = 500 (line 24)
  • access: protected
mixed $thumbImageHeight = 200 (line 27)
  • access: protected
mixed $thumbImageQuality = 65 (line 30)
  • access: protected
mixed $thumbImageWidth = 200 (line 26)
  • access: protected

Inherited Variables

Inherited from FileUploader

FileUploader::$allowedAudioTypes
FileUploader::$allowedImageTypes
FileUploader::$allUploadErrorCodes
FileUploader::$allUploadErrorMessages
FileUploader::$allUploadErrorsFileName
FileUploader::$allUploadErrorsLineNumber
FileUploader::$errorLogFileName
FileUploader::$fileType
FileUploader::$maxUploadSize
FileUploader::$numberOfAllowedFilesToUpload
FileUploader::$numberOfErrors
FileUploader::$numberOfFilesPerDirectory
FileUploader::$numberOfSuccessfulUploads
FileUploader::$originalFilePath
FileUploader::$prependToFileName
FileUploader::$userReadableUploadErrorCodes
FileUploader::$userReadableUploadErrorMessages
Methods
createUploadingDirectory (line 277)

Creates the uploading directory and all children directories if they do not exist

  • return: returns the full folder file path for the uploading directory
  • access: protected
string createUploadingDirectory (string $input)
  • string $input: File path for the start of the uploading directory
echoAllFileNames (line 230)
  • return: returns all file names of images
  • access: public
string echoAllFileNames ()
echoAllPathNames (line 262)
  • return: return all filePaths
  • access: public
string echoAllPathNames ()
getFileNameFull (line 70)
  • access: public
void getFileNameFull ()
getFileNameFullAtIndex (line 207)
  • return: returns fileNameFull at desired index
  • access: public
string getFileNameFullAtIndex (int $index)
  • int $index: Desired fileNameFull index to return
getFileNameSmall (line 77)
  • access: public
void getFileNameSmall ()
getFileNameSmallAtIndex (line 215)
  • return: returns fileNameSmall at desired index
  • access: public
string getFileNameSmallAtIndex (int $index)
  • int $index: Desired fileNameSmall index to return
getFileNameThumb (line 84)
  • access: public
void getFileNameThumb ()
getFileNameThumbAtIndex (line 223)
  • return: returns fileNameThumb at desired index
  • access: public
string getFileNameThumbAtIndex (int $index)
  • int $index: Desired fileNameThumb index to return
getFilePathFull (line 91)
  • access: public
void getFilePathFull ()
getFilePathFullAtIndex (line 242)
  • return: FilePathFull at index number
  • access: public
string getFilePathFullAtIndex (int $index)
  • int $index: desired index of filePathfull
getFilePathSmall (line 101)
  • access: public
void getFilePathSmall ()
getFilePathSmallAtIndex (line 249)
  • return: FilePathSmall at index number
  • access: public
string getFilePathSmallAtIndex (int $index)
  • int $index: desired index of filePathSmall
getFilePathThumb (line 111)
  • access: public
void getFilePathThumb ()
getFilePathThumbAtIndex (line 256)
  • return: FilePathThumb at index number
  • access: public
string getFilePathThumbAtIndex (int $index)
  • int $index: desired index of filepathThumb
getFullImageQuality (line 149)
  • access: public
void getFullImageQuality ( $imageType)
  • $imageType
getOriginalFilePath (line 45)

Getters and Setters

  • access: public
void getOriginalFilePath ()

Implementation of:
iFileUpload::getOriginalFilePath()
getSmallImageHeight (line 128)
  • access: public
void getSmallImageHeight ()
getSmallImageQuality (line 159)
  • access: public
void getSmallImageQuality ( $imageType)
  • $imageType
getSmallImageWidth (line 121)
  • access: public
void getSmallImageWidth ()
getThumbImageHeight (line 142)
  • access: public
void getThumbImageHeight ()
getThumbImageQuality (line 169)
  • access: public
void getThumbImageQuality ( $imageType)
  • $imageType
getThumbImageWidth (line 135)
  • access: public
void getThumbImageWidth ()
keepImageTransparency (line 330)

Retain the image transparency for gif and png images

  • access: protected
void keepImageTransparency (string $image)
  • string $image: image resource
returnMysqlQuery (line 372)

Create a standard MySQL query for quick access to a query

This may not suit everyone ones needs so it may be ignored

The order of the query goes as follows..... ( fileNameFull, fileNameSmall, fileNameThumb, filePathFull, filePathSmall, filePathThumb )

These functions have been "overloaded" to allow for one or two more fields to be applied to the beginning of the query so it could be something like the following.... ( primaryKey, fileNameFull, fileNameSmall, fileNameThumb, filePathFull, filePathSmall, filePathThumb ) or.... ( primaryKey, userID, fileNameFull, fileNameSmall, fileNameThumb, filePathFull, filePathSmall, filePathThumb )

  • return: returns a MySQL formatted query
  • access: public
string returnMysqlQuery ()
returnURLMySQLQuery (line 407)
  • return: returns a MySQL query for an image uploaded from a URL
  • access: public
string returnURLMySQLQuery ()
setFileNameFull (line 73)
  • access: public
void setFileNameFull ( $input)
  • $input
setFileNameSmall (line 80)
  • access: public
void setFileNameSmall ( $input)
  • $input
setFileNameThumb (line 87)
  • access: public
void setFileNameThumb ( $input)
  • $input
setFilePathFull (line 94)
  • access: protected
void setFilePathFull ( $input)
  • $input
setFilePathSmall (line 104)
  • access: protected
void setFilePathSmall ( $input)
  • $input
setFilePathThumb (line 114)
  • access: protected
void setFilePathThumb ( $input)
  • $input
setFullImageQuality (line 155)
  • access: public
void setFullImageQuality ( $input)
  • $input
setOriginalFilePath (line 48)
  • access: public
void setOriginalFilePath ( $input)
  • $input

Implementation of:
iFileUpload::setOriginalFilePath()
setSmallImageHeight (line 131)
  • access: public
void setSmallImageHeight ( $input)
  • $input
setSmallImageQuality (line 165)
  • access: public
void setSmallImageQuality ( $input)
  • $input
setSmallImageWidth (line 124)
  • access: public
void setSmallImageWidth ( $input)
  • $input
setSmallImageWidthAndHeight (line 186)

Set the desired height and width of the small images in two functions instead of using the setters

  • access: public
void setSmallImageWidthAndHeight (int $w, int $h)
  • int $w: Desired width of small image
  • int $h: Desired height of small image
setThumbImageHeight (line 145)
  • access: public
void setThumbImageHeight ( $input)
  • $input
setThumbImageQuality (line 175)
  • access: public
void setThumbImageQuality ( $input)
  • $input
setThumbImageWidth (line 138)
  • access: public
void setThumbImageWidth ( $input)
  • $input
setThumbImageWidthAndHeight (line 197)

Set the desired height and width of the thumb images in two functions instead of using the setters

  • access: public
void setThumbImageWidthAndHeight (int $w, int $h)
  • int $w: Desired width of thumb image
  • int $h: Desired height of thumb image

Inherited Methods

Inherited From FileUploader

 FileUploader::checkDirectoryStatus()
 FileUploader::checkIfFileExists()
 FileUploader::countItemsInDirectory()
 FileUploader::createDirectory()
 FileUploader::detectFileType()
 FileUploader::fileIsNotEmpty()
 FileUploader::fileSmallEnoughForUpload()
 FileUploader::getErrorLogFilename()
 FileUploader::getFileType()
 FileUploader::getFileTypeForUpload()
 FileUploader::getMaxUploadSize()
 FileUploader::getNumberOfAllowedFilesToUpload()
 FileUploader::getNumberOfErrorsDuringUpload()
 FileUploader::getNumberOfFilesPerDirectory()
 FileUploader::getNumberOfSuccessfulUploads()
 FileUploader::getPrependToFileName()
 FileUploader::inParentDirectory()
 FileUploader::isAcceptableFileType()
 FileUploader::returnAllUploadErrorCodes()
 FileUploader::returnAllUploadErrorMessages()
 FileUploader::returnAllUploadErrorsFileName()
 FileUploader::returnAllUploadErrorsLineNumber()
 FileUploader::returnFormattedErrors()
 FileUploader::returnUploadErrorCodeAtIndex()
 FileUploader::returnUploadErrorFileNameAtIndex()
 FileUploader::returnUploadErrorLineNumberAtIndex()
 FileUploader::returnUploadErrorMessageAtIndex()
 FileUploader::returnUserReadableUploadErrorCodes()
 FileUploader::returnUserReadableUploadErrorMessages()
 FileUploader::setErrorLogFilename()
 FileUploader::setFileType()
 FileUploader::setFileTypeForUpload()
 FileUploader::setMaxUploadSize()
 FileUploader::setNumberOfAllowedFilesToUpload()
 FileUploader::setNumberOfFilesPerDirectory()
 FileUploader::setPrependToFileName()
 FileUploader::validateFile()
 FileUploader::writeAllErrorsToLog()
Class Constants
GIF = 'gif' (line 40)
JPG = 'jpg' (line 38)
PNG = 'png' (line 39)

Documentation generated on Wed, 28 Aug 2013 22:54:21 -0500 by phpDocumentor 1.4.4