Back to PhocaGalleryImage class

Method getImageSize

public static
getImageSize
(mixed $filename, mixed $returnString = 0, mixed $extLink = 0)

Method getImageSize - Source code

public static function getImageSize($filename, $returnString = 0, $extLink = 0)
{
    phocagalleryimport('phocagallery.image.image');
    phocagalleryimport('phocagallery.path.path');
    if ($extLink == 1) {
        $fileNameAbs = $filename;
    } else {
        $path = PhocaGalleryPath::getPath();
        $fileNameAbs = Path::clean($path->image_abs . $filename);
        if (!File::exists($fileNameAbs)) {
            $fileNameAbs = $path->image_abs_front . 'phoca_thumb_l_no_image.png';
        }
    }
    if ($returnString == 1) {
        $imageSize = @getimagesize($fileNameAbs);
        return $imageSize[0] . ' x ' . $imageSize[1];
    } else {
        return @getimagesize($fileNameAbs);
    }
}