src/Blob/BlobUtil.php
public static function isPngOrJpeg($FILE_DESCRIPTOR)
    {
        if ( !isset($FILE_DESCRIPTOR['name']) ) return false;
        if ( !isset($FILE_DESCRIPTOR['tmp_name']) ) return false;
        $info = getimagesize($FILE_DESCRIPTOR['tmp_name']);
        if ( ! is_array($info) ) return false;

        $image_type = $info[2];
        return $image_type == IMAGETYPE_JPEG || $image_type == IMAGETYPE_PNG;
    }
public static function isPngOrJpeg($FILE_DESCRIPTOR)
    {
        if ( !isset($FILE_DESCRIPTOR['name']) ) return false;
        if ( !isset($FILE_DESCRIPTOR['tmp_name']) ) return false;
        $info = getimagesize($FILE_DESCRIPTOR['tmp_name']);
        if ( ! is_array($info) ) return false;

        $image_type = $info[2];
        return $image_type == IMAGETYPE_JPEG || $image_type == IMAGETYPE_PNG;
    }
public static function isPngOrJpeg ( $ FILE_DESCRIPTOR ) { if ( ! isset ( $ FILE_DESCRIPTOR [ 'name' ] ) ) return false ; if ( ! isset ( $ FILE_DESCRIPTOR [ 'tmp_name' ] ) ) return false ; $ info = getimagesize ( $ FILE_DESCRIPTOR [ 'tmp_name' ] ) ; if ( ! is_array ( $ info ) ) return false ; $ image_type = $ info [ 2 ] ; return $ image_type == IMAGETYPE_JPEG || $ image_type == IMAGETYPE_PNG ; }
Make sure the contents of this file are a PNG or JPEG
Make sure the contents of this file are a PNG or JPEG