roundcubemail/program/lib/Roundcube/rcube_image.php
private function mem_check($props)
    {
        // image size is unknown, we can't calculate required memory
        if (!$props['width']) {
            return true;
        }

        // channels: CMYK - 4, RGB - 3
        $multip = ($props['channels'] ?: 3) + 1;

        // calculate image size in memory (in bytes)
        $size = $props['width'] * $props['height'] * $multip;
        return rcube_utils::mem_check($size);
    }
private function mem_check($props)
    {
        // image size is unknown, we can't calculate required memory
        if (!$props['width']) {
            return true;
        }

        // channels: CMYK - 4, RGB - 3
        $multip = ($props['channels'] ?: 3) + 1;

        // calculate image size in memory (in bytes)
        $size = $props['width'] * $props['height'] * $multip;
        return rcube_utils::mem_check($size);
    }
private function mem_check ( $ props ) { // image size is unknown, we can't calculate required memory if ( ! $ props [ 'width' ] ) { return true ; } // channels: CMYK - 4, RGB - 3 $ multip = ( $ props [ 'channels' ] ? : 3 ) + 1 ; // calculate image size in memory (in bytes) $ size = $ props [ 'width' ] * $ props [ 'height' ] * $ multip ; return rcube_utils :: mem_check ( $ size ) ; }
Check if we have enough memory to load specified image
Check if we have enough memory to load specified image