$uid = $request_user->ID;        $cropped_full = USER_AVATAR_UPLOAD_PATH.“{$uid}/”.time().“-bpfull.jpg”;     $cropped_thumb = USER_AVATAR_UPLOAD_PATH.“{$uid}/”.time().“-bpthumb.jpg”;          // Create image from file         switch(strtolower($_FILES[‘file’][‘type’]))         {             case ‘image/jpeg’:                 $fn = $_FILES[‘file’][‘tmp_name’];                 $height_width = $this->get_image_ratio_height_width($fn);                                  $width = $height_width[‘width’];                 $height = $height_width[‘height’];                 $size = $height_width[‘size’];                 $src = imagecreatefromstring(file_get_contents($fn));                 $dst = imagecreatetruecolor($width,$height);                 imagecopyresampled($dst,$src,0,0,0,0,$width,$height,$size[0],$size[1]);                 imagedestroy($src);                                  imagejpeg($dst,$cropped_full); // adjust format as needed                 imagedestroy($dst);                 $url=user_avatar_fetch_avatar( array( ‘html’=>false, […]

     $request_user = $this->validation->get_user_info();    if(!$request_user)    return $this->validation->response(“Missing header or invalid authtoken”, null , 400);       $uid = $request_user->ID;    global $user_current_id_API;    $user_current_id_API = $uid;    $cropped_full = USER_AVATAR_UPLOAD_PATH.“{$uid}/”.time().“-bpfull.jpg”;     $cropped_thumb = USER_AVATAR_UPLOAD_PATH.“{$uid}/”.time().“-bpthumb.jpg”;          $uploadedfile = $_FILES[‘file’];         $upload_overrides = array( ‘test_form’ => false );                  add_filter(‘wp_handle_upload_prefilter’, ‘custom_upload_filter’ );         function custom_upload_filter( $file ){             $file[‘name’] = […]