public function get_image_size_in_draft_area($draftitemid) {
        global $USER;
        $usercontext = context_user::instance($USER->id);
        $fs = get_file_storage();
        $draftfiles = $fs->get_area_files($usercontext->id, 'user', 'draft', $draftitemid, 'id');
        if ($draftfiles) {
            foreach ($draftfiles as $file) {
                if ($file->is_directory()) {
                    continue;
                }
                // Just return the data for the first good file, there should only be one.
                $imageinfo = $file->get_imageinfo();
                $width    = $imageinfo['width'];
                $height   = $imageinfo['height'];
                return array($width, $height);
            }
        }
        return null;
    }
public function get_image_size_in_draft_area($draftitemid) {
        global $USER;
        $usercontext = context_user::instance($USER->id);
        $fs = get_file_storage();
        $draftfiles = $fs->get_area_files($usercontext->id, 'user', 'draft', $draftitemid, 'id');
        if ($draftfiles) {
            foreach ($draftfiles as $file) {
                if ($file->is_directory()) {
                    continue;
                }
                // Just return the data for the first good file, there should only be one.
                $imageinfo = $file->get_imageinfo();
                $width    = $imageinfo['width'];
                $height   = $imageinfo['height'];
                return array($width, $height);
            }
        }
        return null;
    }
public function get_image_size_in_draft_area ( $ draftitemid ) { global $ USER ; $ usercontext = context_user :: instance ( $ USER -> id ) ; $ fs = get_file_storage ( ) ; $ draftfiles = $ fs -> get_area_files ( $ usercontext -> id , 'user' , 'draft' , $ draftitemid , 'id' ) ; if ( $ draftfiles ) { foreach ( $ draftfiles as $ file ) { if ( $ file -> is_directory ( ) ) { continue ; } // Just return the data for the first good file, there should only be one. $ imageinfo = $ file -> get_imageinfo ( ) ; $ width = $ imageinfo [ 'width' ] ; $ height = $ imageinfo [ 'height' ] ; return array ( $ width , $ height ) ; } } return null ; }
Gets the width and height of a draft image.

@param int $draftitemid ID of the draft image
@return array Return array of the width and height of the draft image.
Gets the width and height of a draft image .