public function is_valid_image() {
        $mimetype = $this->get_mimetype();
        if (!file_mimetype_in_typegroup($mimetype, 'web_image')) {
            return false;
        }
        if (!$info = $this->get_imageinfo()) {
            return false;
        }
        if ($info['mimetype'] !== $mimetype) {
            return false;
        }
        // ok, GD likes this image
        return true;
    }
public function is_valid_image() {
        $mimetype = $this->get_mimetype();
        if (!file_mimetype_in_typegroup($mimetype, 'web_image')) {
            return false;
        }
        if (!$info = $this->get_imageinfo()) {
            return false;
        }
        if ($info['mimetype'] !== $mimetype) {
            return false;
        }
        // ok, GD likes this image
        return true;
    }
public function is_valid_image ( ) { $ mimetype = $ this -> get_mimetype ( ) ; if ( ! file_mimetype_in_typegroup ( $ mimetype , 'web_image' ) ) { return false ; } if ( ! $ info = $ this -> get_imageinfo ( ) ) { return false ; } if ( $ info [ 'mimetype' ] !== $ mimetype ) { return false ; } // ok, GD likes this image return true ; }
Verifies the file is a valid web image - gif, png and jpeg only.

It should be ok to serve this image from server without any other security workarounds.

@return bool true if file ok
Verifies the file is a valid web image - gif png and jpeg only .