TijsVerkoyen\Twitter\Twitter::accountUpdateProfileImage PHP Method

accountUpdateProfileImage() public method

Updates the authenticating user's profile image.
public accountUpdateProfileImage ( string $image, bool[optional] $includeEntities = null ) : array
$image string The path to the avatar image for the profile. Must be a valid GIF, JPG, or PNG image of less than 700 kilobytes in size. Images with width larger than 500 pixels will be scaled down.
$includeEntities bool[optional]
return array
    public function accountUpdateProfileImage($image, $includeEntities = null)
    {
        // validate
        if (!file_exists($image)) {
            throw new Exception('Image (' . $image . ') doesn\'t exists.');
        }
        // build parameters
        $parameters = null;
        if ($includeEntities !== null) {
            $parameters['include_entities'] = $includeEntities ? 'true' : 'false';
        }
        // make the call
        return $this->doCall('account/update_profile_image.json', $parameters, true, 'POST', $image);
    }
Twitter