Function cApiImgScaleHQ
Scales (or crops) an image in high quality. If scaling, the aspect ratio is maintained.
Note: GDLib 2.x is required! Note: Image cropping calculates center of the image!
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 the specified cache time, 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 |
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
|
Url to the resulting image (http://...) |