Back to PhocaGalleryImage class

Method getTransformImageArray

public static
getTransformImageArray
(mixed $imgSize, mixed $rate)

Method getTransformImageArray - Source code

/*
 * Transform image (only with html method) for overlib effect e.g.
 *
 * @param array An array of image size (width, height)
 * @param int Rate
 * @access public
 */
public static function getTransformImageArray($imgSize, $rate)
{
    if (isset($imgSize[0]) && isset($imgSize[1])) {
        $w = (int) $imgSize[0];
        $h = (int) $imgSize[1];
        if ($w != 0) {
            $w = $w / $rate;
        }
        // plus or minus should be divided, not null
        if ($h != 0) {
            $h = $h / $rate;
        }
        $wHOutput = array('width' => $w, 'height' => $h, 'style' => 'background: #fff url(' . Uri::base(true) . '/media/com_phocagallery/images/icon-loading2.gif) 50% 50% no-repeat;');
    } else {
        $w = $h = 0;
        $wHOutput = array();
    }
    return $wHOutput;
}