contenido\includes\functions.api.images.php

Show: PublicProtectedPrivateinherited
    Table of Contents
    Project: Contenido Content Management System

    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

    functioncapiImgScale(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.

    Parameters
    NameTypeDescription
    $imgstring

    The path to the image (relative to the frontend)

    $maxXint

    The maximum size in x-direction

    $maxYint

    The maximum size in y-direction

    $cropboolean

    If true, the image is cropped and not scaled.

    $expandboolean

    If true, the image is expanded (e.g. really scaled). If false, the image will only be made smaller.

    $cacheTimeint

    The number of minutes to cache the image, use 0 for unlimited

    $wantHQboolean

    If true, try to force high quality mode

    $qualityint

    The quality of the output file

    $keepTypeboolean

    If true and a png file is source, output file is also png

    Returns
    TypeDescription
    stringstring!!!URL!!! to the resulting image (http://...)Path to the resulting image
    functioncapiImgScaleGetMD5CacheFile( $sImg,  $iMaxX,  $iMaxY,  $bCrop,  $bExpand) : string

    capiImgScaleGetMD5CacheFile: Returns the MD5 Filename used for caching.

    Parameters
    NameTypeDescription
    $sImg
    $iMaxX
    $iMaxY
    $bCrop
    $bExpand
    Returns
    TypeDescription
    stringPath to the resulting image
    functioncapiImgScaleHQ(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.

    Parameters
    NameTypeDescription
    $imgstring

    The path to the image (relative to the frontend)

    $maxXint

    The maximum size in x-direction

    $maxYint

    The maximum size in y-direction

    $cropboolean

    If true, the image is cropped and not scaled.

    $expandboolean

    If true, the image is expanded (e.g. really scaled). If false, the image will only be made smaller.

    $cacheTimeint

    The number of minutes to cache the image, use 0 for unlimited

    $qualityint

    The quality of the output file

    $keepTypeboolean

    If true and a png file is source, output file is also png

    Returns
    TypeDescription
    string!!!URL!!! to the resulting image (http://...)
    functioncapiImgScaleImageMagick(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.

    Parameters
    NameTypeDescription
    $imgstring

    The path to the image (relative to the frontend)

    $maxXint

    The maximum size in x-direction

    $maxYint

    The maximum size in y-direction

    $cropboolean

    If true, the image is cropped and not scaled.

    $expandboolean

    If true, the image is expanded (e.g. really scaled). If false, the image will only be made smaller.

    $cacheTimeint

    The number of minutes to cache the image, use 0 for unlimited

    $qualityint

    The quality of the output file

    $keepTypeboolean

    If true and a png file is source, output file is also png

    Returns
    TypeDescription
    string!!!URL!!! to the resulting image (http://...)
    functioncapiImgScaleLQ(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.

    Parameters
    NameTypeDescription
    $imgstring

    The path to the image (relative to the frontend)

    $maxXint

    The maximum size in x-direction

    $maxYint

    The maximum size in y-direction

    $cropboolean

    If true, the image is cropped and not scaled.

    $expandboolean

    If true, the image is expanded (e.g. really scaled). If false, the image will only be made smaller.

    $cacheTimeint

    The number of minutes to cache the image, use 0 for unlimited

    $qualityint

    The quality of the output file

    $keepTypeboolean

    If true and a png file is source, output file is also png

    Returns
    TypeDescription
    string!!!URL!!! to the resulting image (http://...
    functioncheckImageEditingPosibility() : void

    check possible image editing functionality

    return mixed information about installed image editing extensions/tools

    functionisAnimGif(string $sFile) : boolean

    check if gif is animated

    Parameters
    NameTypeDescription
    $sFilestring

    file path

    Returns
    TypeDescription
    booleantrue (gif is animated)/ false (single frame gif)
    Documentation was generated by phpDocumentor 2.0.0a12.