$control |
string |
The file upload control's name
@param string $prefix If the resized image is to be saved as a new file and the originally
uploaded file needs to be preserved, specify a prefix to be used for the
new file. This way, the resized image will have the same name as the
original file but prefixed with the given value (i.e. "thumb_").
Specifying an empty string as argument will instruct the script to apply
the resizing to the uploaded image and therefore overwriting the
originally uploaded file.
@param integer $width The width to resize the image to.
If set to 0, the width will be automatically adjusted, depending
on the value of the height argument so that the image preserves
its aspect ratio.
If preserve_aspect_ratio is set to TRUE and both this and the
height arguments are values greater than 0, the image will
be resized to the exact required width and height and the aspect ratio
will be preserved (see the description for the method argument
below on how can this be done).
If preserve_aspect_ratio is set to FALSE, the image will be
resized to the required width and the aspect ratio will be ignored.
If both width and height are set to 0, a copy of
the source image will be created (jpeg_quality will still apply).
If either width or height are set to 0, the script
will consider the value of the {@link preserve_aspect_ratio} to bet set
to TRUE regardless of its actual value!
@param integer $height The height to resize the image to.
If set to 0, the height will be automatically adjusted, depending
on the value of the width argument so that the image preserves
its aspect ratio.
If preserve_aspect_ratio is set to TRUE and both this and the
width arguments are values greater than 0, the image will
be resized to the exact required width and height and the aspect ratio
will be preserved (see the description for the method argument
below on how can this be done).
If preserve_aspect_ratio is set to FALSE, the image will be
resized to the required height and the aspect ratio will be ignored.
If both height and width are set to 0, a copy of
the source image will be created (jpeg_quality will still apply).
If either height or width are set to 0, the script
will consider the value of the {@link preserve_aspect_ratio} to bet set
to TRUE regardless of its actual value!
@param boolean $preserve_aspect_ratio (Optional) If set to TRUE, the image will be resized to the given width
and height and the aspect ratio will be preserved.
Set this to FALSE if you want the image forcefully resized to the exact
dimensions given by width and height ignoring the aspect ratio
Default is TRUE.
@param int $method (Optional) Method to use when resizing images to exact width and height
while preserving aspect ratio.
If the $preserve_aspect_ratio property is set to TRUE and both the
width and height arguments are values greater than 0,
the image will be resized to the exact given width and height and the
aspect ratio will be preserved by using on of the following methods:
- ZEBRA_IMAGE_BOXED - the image will be scalled so that it will
fit in a box with the given width and height (both width/height will
be smaller or equal to the required width/height) and then it will
be centered both horizontally and vertically. The blank area will be
filled with the color specified by the $background_color
argument. (the blank area will be filled only if the image is not
transparent!)
- ZEBRA_IMAGE_NOT_BOXED - the image will be scalled so that it
could fit in a box with the given width and height but will
not be enclosed in a box with given width and height. The new width/
height will be both smaller or equal to the required width/height
- ZEBRA_IMAGE_CROP_TOPLEFT
- ZEBRA_IMAGE_CROP_TOPCENTER
- ZEBRA_IMAGE_CROP_TOPRIGHT
- ZEBRA_IMAGE_CROP_MIDDLELEFT
- ZEBRA_IMAGE_CROP_CENTER
- ZEBRA_IMAGE_CROP_MIDDLERIGHT
- ZEBRA_IMAGE_CROP_BOTTOMLEFT
- ZEBRA_IMAGE_CROP_BOTTOMCENTER
- ZEBRA_IMAGE_CROP_BOTTOMRIGHT
For the methods involving crop, first the image is scaled so that both
its sides are equal or greater than the respective sizes of the bounding
box; next, a region of required width and height will be cropped from
indicated region of the resulted image.
Default is ZEBRA_IMAGE_BOXED
@param boolean $background_color (Optional) The hexadecimal color of the blank area (without the #).
See the method argument.
Default is 'FFFFFF'
@param boolean $enlarge_smaller_images (Optional) If set to FALSE, images having both width and height smaller
than the required width and height, will be left untouched ({@link jpeg_quality}
will still apply).
Default is TRUE
@param boolean $quality (Optional) Indicates the quality of the output image (better quality
means bigger file size).
Range is 0 - 100
Available only for JPEG files.
Default is 85
@return boolean Returns TRUE on success or FALSE otherwise
@access private |