contenido\includes\functions.api.images.php
Description: Contenido Image API functions
Requirements:
- Author
- Timo A. Hummel
- Con_php_req
- 5.0
- Copyright
- four for business AG
- License
- http://www.contenido.org/license/LIZENZ.txt
- Link
- http://www.4fb.de
- Link
- http://www.contenido.org
- Package
- Contenido Backend includes
- Since
- file available since contenido release <= 4.6 {@internal created 2003-08-08 modified 2008-06-25, Frederic Schneider, add security fix $Id: functions.api.images.php 309 2008-06-26 10:06:56Z frederic.schneider $: }}
- Version
- 1.4.3
Functions

capiImgScale(string $img, int $maxX, int $maxY, boolean $crop = false, boolean $expand = false, int $cacheTime = 10, boolean $wantHQ = false, int $quality = 75, boolean $keepType = true) : stringstring
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.
Name | Type | Description |
---|---|---|
$img | string | The path to the image (relative to the frontend) |
$maxX | int | The maximum size in x-direction |
$maxY | int | The maximum size in y-direction |
$crop | boolean | If true, the image is cropped and not scaled. |
$expand | boolean | If true, the image is expanded (e.g. really scaled). If false, the image will only be made smaller. |
$cacheTime | int | The number of minutes to cache the image, use 0 for unlimited |
$wantHQ | boolean | If true, try to force high quality mode |
$quality | int | The quality of the output file |
$keepType | boolean | If true and a png file is source, output file is also png |
Type | Description |
---|---|
stringstring | !!!URL!!! to the resulting image (http://...)Path to the resulting image |

capiImgScaleGetMD5CacheFile( $sImg, $iMaxX, $iMaxY, $bCrop, $bExpand) : string
capiImgScaleGetMD5CacheFile: Returns the MD5 Filename used for caching.
Name | Type | Description |
---|---|---|
$sImg | ||
$iMaxX | ||
$iMaxY | ||
$bCrop | ||
$bExpand |
Type | Description |
---|---|
string | Path to the resulting image |

capiImgScaleHQ(string $img, int $maxX, int $maxY, boolean $crop = false, boolean $expand = false, int $cacheTime = 10, int $quality = 75, boolean $keepType = true) : string
capiImgScaleHQ: Scales (or crops) an image in high quality.
If scaling, the aspect ratio is maintained.
Note: GDLib 2.x is required!
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.
Name | Type | Description |
---|---|---|
$img | string | The path to the image (relative to the frontend) |
$maxX | int | The maximum size in x-direction |
$maxY | int | The maximum size in y-direction |
$crop | boolean | If true, the image is cropped and not scaled. |
$expand | boolean | If true, the image is expanded (e.g. really scaled). If false, the image will only be made smaller. |
$cacheTime | int | The number of minutes to cache the image, use 0 for unlimited |
$quality | int | The quality of the output file |
$keepType | boolean | If true and a png file is source, output file is also png |
Type | Description |
---|---|
string | !!!URL!!! to the resulting image (http://...) |

capiImgScaleImageMagick(string $img, int $maxX, int $maxY, boolean $crop = false, boolean $expand = false, int $cacheTime = 10, int $quality = 75, boolean $keepType = false) : string
capiImgScaleImageMagick: Scales (or crops) an image using ImageMagick.
If scaling, the aspect ratio is maintained.
Note: ImageMagick is required!
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.
Name | Type | Description |
---|---|---|
$img | string | The path to the image (relative to the frontend) |
$maxX | int | The maximum size in x-direction |
$maxY | int | The maximum size in y-direction |
$crop | boolean | If true, the image is cropped and not scaled. |
$expand | boolean | If true, the image is expanded (e.g. really scaled). If false, the image will only be made smaller. |
$cacheTime | int | The number of minutes to cache the image, use 0 for unlimited |
$quality | int | The quality of the output file |
$keepType | boolean | If true and a png file is source, output file is also png |
Type | Description |
---|---|
string | !!!URL!!! to the resulting image (http://...) |

capiImgScaleLQ(string $img, int $maxX, int $maxY, boolean $crop = false, boolean $expand = false, int $cacheTime = 10, int $quality = 75, boolean $keepType = false) : string
capiImgScaleLQ: Scales (or crops) an image.
If scaling, the aspect ratio is maintained.
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.
Name | Type | Description |
---|---|---|
$img | string | The path to the image (relative to the frontend) |
$maxX | int | The maximum size in x-direction |
$maxY | int | The maximum size in y-direction |
$crop | boolean | If true, the image is cropped and not scaled. |
$expand | boolean | If true, the image is expanded (e.g. really scaled). If false, the image will only be made smaller. |
$cacheTime | int | The number of minutes to cache the image, use 0 for unlimited |
$quality | int | The quality of the output file |
$keepType | boolean | If true and a png file is source, output file is also png |
Type | Description |
---|---|
string | !!!URL!!! to the resulting image (http://... |

checkImageEditingPosibility() : void
check possible image editing functionality
return mixed information about installed image editing extensions/tools