Sample Code:
Visualforce page:
Visualforce page:
<apex:page controller=”Sample”>
<apex:pageBlock >
<apex:image value=”{!photoURL}”/>
</apex:pageBlock>
</apex:page>
Apex Controller:
public class Sample {
public String photoURL {get;set;}
public sample() {
photoURL = [SELECT Id, smallPhotoURL FROM User WHERE ID =: UserInfo.getUserId()].smallPhotoURL;
}
}
Output:
Cheers!!!