Function cApiImgScale
Scales (or crops) an image. If scaling, the aspect ratio is maintained.
This function chooses the best method to scale, depending on the system environment and/or the parameters.
Returns the path to the scaled temporary image.
Note that this function does some very poor caching; it calculates an md5 hash out of the image plus the maximum X and Y sizes, and uses that as the file name. If the file is older than 10 minutes, regenerate it.
Package: Core\Backend
Copyright: four for business AG <www.4fb.de>
License: http://www.contenido.org/license/LIZENZ.txt
Author: Timo Hummel
Located at includes/functions.api.images.php
Copyright: four for business AG <www.4fb.de>
License: http://www.contenido.org/license/LIZENZ.txt
Author: Timo Hummel
Located at includes/functions.api.images.php
string |
$img |
The path to the image (relative to the frontend) |
integer |
$maxX |
The maximum size in x-direction |
integer |
$maxY |
The maximum size in y-direction |
boolean |
$crop = false |
If true, the image is cropped and not scaled. |
boolean |
$expand = false |
If true, the image is expanded (e.g. really scaled). If false, the image will only be made smaller. |
integer |
$cacheTime = 10 |
The number of minutes to cache the image, use 0 for unlimited |
boolean |
$wantHQ = false |
If true, try to force high quality mode |
integer |
$quality = 75 |
The quality of the output file |
boolean |
$keepType = true |
If true and a png file is source, output file is also png |
string
|
Path to the resulting image |