src/whatsprot.class.php
protected function sendSetPicture($jid, $filepath)
    {
        $nodeID = $this->createIqId();

        $data = preprocessProfilePicture($filepath);
        $preview = createIconGD($filepath, 96, true);

        $picture = new ProtocolNode('picture', ['type' => 'image'], null, $data);
        $preview = new ProtocolNode('picture', ['type' => 'preview'], null, $preview);

        $node = new ProtocolNode('iq', [
            'id'    => $nodeID,
            'to'    => $this->getJID($jid),
            'type'  => 'set',
            'xmlns' => 'w:profile:picture',
        ], [$picture, $preview], null);

        $this->sendNode($node);
    }
protected function sendSetPicture($jid, $filepath)
    {
        $nodeID = $this->createIqId();

        $data = preprocessProfilePicture($filepath);
        $preview = createIconGD($filepath, 96, true);

        $picture = new ProtocolNode('picture', ['type' => 'image'], null, $data);
        $preview = new ProtocolNode('picture', ['type' => 'preview'], null, $preview);

        $node = new ProtocolNode('iq', [
            'id'    => $nodeID,
            'to'    => $this->getJID($jid),
            'type'  => 'set',
            'xmlns' => 'w:profile:picture',
        ], [$picture, $preview], null);

        $this->sendNode($node);
    }
protected function sendSetPicture ( $ jid , $ filepath ) { $ nodeID = $ this -> createIqId ( ) ; $ data = preprocessProfilePicture ( $ filepath ) ; $ preview = createIconGD ( $ filepath , 96 , true ) ; $ picture = new ProtocolNode ( 'picture' , [ 'type' => 'image' ] , null , $ data ) ; $ preview = new ProtocolNode ( 'picture' , [ 'type' => 'preview' ] , null , $ preview ) ; $ node = new ProtocolNode ( 'iq' , [ 'id' => $ nodeID , 'to' => $ this -> getJID ( $ jid ) , 'type' => 'set' , 'xmlns' => 'w:profile:picture' , ] , [ $ picture , $ preview ] , null ) ; $ this -> sendNode ( $ node ) ; }
Set your profile picture.

@param string $jid
@param string $filepath URL or localpath to image file
Set your profile picture .