Back to PhocaGalleryFile class

Method getFileFormat

public static
getFileFormat
(mixed $filename)

Method getFileFormat - Source code

public static function getFileFormat($filename)
{
    $path = PhocaGalleryPath::getPath();
    $file = Path::clean($path->image_abs . $filename);
    $size = getimagesize($file);
    if (isset($size[0]) && isset($size[1]) && (int) $size[1] > (int) $size[0]) {
        return 2;
    } else {
        return 1;
    }
}