ImageResizer Class
Handles image resize; can output to file or directly to browser. Located in the namespace Canteen\Media.
Constructor
ImageResizer
(
-
fileOriginal
-
[jpegQuality=85]
Parameters:
-
fileOriginal
StringThe native path to the original file
-
[jpegQuality=85]
Int optionalThe JPEG compression from 0 to 100
Item Index
Properties
- jpegQuality
- RESIZE_DISTORT static
- RESIZE_MAX_FILL static
- RESIZE_MAX_FILL_CROP static
- RESIZE_MIN_FILL static
- useGD2
Methods
clear
()
private
Clear all the class member varaibles
destroy
()
Destroy this instance and any temporary files
outputImage
(
Boolean
private
-
destinationFile
-
imageType
-
image
Abstract method to save an image to a destination
Parameters:
Returns:
Boolean:
If we saved the file successfully
outputOriginal
(
Boolean
-
destinationFile
-
imageType
Output the original image
Returns:
Boolean:
If we were successfully able to save
outputResized
(
Boolean
-
destinationFile
-
imageType
Output the resized image
Returns:
Boolean:
If we were successfully able to save
resize
(
-
desiredWidth
-
desiredHeight
-
[mode=self::RESIZE_MIN_FILL]
Resize the image
Parameters:
-
desiredWidth
IntThe desired output width, can be '*' for autosize
-
desiredHeight
IntThe desired output height, can be '*' for autosize
-
[mode=self::RESIZE_MIN_FILL]
String optionalThe resize mode for the image
Properties
jpegQuality
Int
The JPEG quality from 0 to 100
Default: 85