Talk:Fb:profile-pic
From Facebook Developer Wiki
Someone please post pictures of what each size looks like. Thanks. 12933936 06:22, 23 July 2007 (PDT)
[edit] Alt???
Can there be an option to print the user's name as an "alt" tag for the image, so when users hover over a profile-pic, it would give the username which represents that pic? I run GridView and my user's have been asking for this feature. --1464390298 13:51, 1 August 2007 (PDT)
[edit] Image Quality
Why are the generated images for this tag so low in quality? 1030920097 16:01, 12 February 2009 (PST)
[edit] Title optional
By default this tag adds the users name as both the alt and the title tag for the image. Could title possibly be changed to an optional parameter with true as default? I can understand the alt tag for if an image fails to load, but the current default behaviour means it is not possible to wrap the image in your own link with its own title.--hjb 11:44, 20 September 2007 (PDT)
[edit] Remove Alt!!!
Our users are being spammed, because people can look up their names using the automatic alt function built into the profile pic. Please make a boolean so that this may be disabled! -April 2008
[edit] More valid value for size
User's profile pictures are so difference that we need to resize the picture for the consistence. Up to now, the valid values for the size can't satisfy our requirement.
[edit] image align property
is there any way to get eg. " align='middle' " onto these profile pics for layout purposes?
- From the doc: "The tag itself is treated like a standard img tag, so attributes valid for img are valid with fb:profile-pic as well." So you could use align=top|middle|etc, or use CSS and float. -- Pete (User:563683308)
[edit] Target="_blank"
Can you add a target attribute to img link? I'd like to link out to a new page when I click on the facebook profile pic. -- Kevin (152400531)
I second this request -- Joe (24402817)
I'd like to use a target of _top. Using this tag via XFBML in an iframe app causes the user's profile to load in my app iframe. Can this be added? In the meantime, I have to prevent the image from being linked. --607512358 12:02, 8 April 2009 (PDT)
I also need this -- Nbd
I need this too! -- Rmz, 9/9/2009
I feel a little stupid for not having realized this before, but there's a misconception and simple solution occurring here. <fb:profile-pic> is converted to an <img> tag. But <img> tags don't have links! Images can be linked by wrapping them in <a> tags, which can have a 'target' attribute just fine. With only a little bit of FB knowledge:
<a href="http://www.facebook.com/profile.php?id=XXXXX" target="_BLANK"> <fb:profile-pic uid="XXXXX" linked="false" /> </a>
Will get you exactly what you want :) Wish I'd realized this on my last project! -- ACB, 9/11/2009
[edit] Using both the size and width & height
If you just set the width and height to the same value, e.g. width="32" height="32", the pictures shown are usually distorted, because it's trying to render whatever shape the original profile image is in a square's area. Use both size="square" and the height and width, and all the profile pics will render properly.
--- sorry but this just isn't true. If you try to render a size greater than like 50px with square, it will look like garbage.
[edit] facebook-logo, unfriendly naming
Elsewhere in the FBML and API, hyphens have been left out of property names, since not all languages (and I'm thinking of Facebooker here) are hyphen-friendly all the time. It would be a fantastic help if 'facebook-logo' could be changed to 'facebooklogo', or aliased to 'logo'. -- Ben (User:500061865)
- With Facebooker:
<%= fb_profile_pic friend, :size => :normal, 'facebook-logo' => true %>
--Ryan Funduk 09:25, 24 March 2009 (PDT)
[edit] "size" not optional
Apparently, if you only specify width and height, the profile pic doesn't show up on your app pages; after we added the size attribute, it started to appear. I'm not sure if this is a issue specific to Facebook Connect applications only.
- It's supposed to be optional. If you're finding that you can reproduce this issue, please file a bug, include the steps to reproduce the issue and a URL we can check, if possible. Thanks, Pete (563683308 12:24, 3 April 2009 (PDT))
[edit] rounded corners
Is there, or will there ever be, a parameter to make the corners rounded on these? - Robin 08:16, 30 March 2009 (PDT)
I'd like to second the request for rounded corners. There's no way to do emulate as far as I can tell since the profile-pic tag spits out the entire image tag.
- Thanks for the request. I did mention it internally but don't have an answer for you yet! Pete (563683308 20:39, 4 April 2009 (PDT))
- Hey Pete, thanks for the response. I did actually work out a solution to do this myself by inspecting the CSS on profile pictures, which gives me a choice of white or light blue background for rounded corners. Would be really nice to be able to specify this in the FBML :) - Robin 03:02, 9 April 2009 (PDT)
- This would be a great feature to have! --6811960 15:48, 17 August 2009 (PDT)
[edit] problems with pic
Suddenly profile pics disappear from my application (fconnect + asp) . I see only profile logo with no link to facebook profile . Only in a page (sometimes) the pic appear. Someone has a solution ?
this is the code i used
fb: comments appear normally
why????
<script src=
"http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php"
type="text/javascript"></script>
<fb:comments></fb:comments> <fb:profile-pic uid="1064620652" linked="false" size="pic_square" width="70" height="65"> </fb:profile-pic>
<fb:profile-pic uid=1064620652 linked="true" size="thumb"></fb:profile-pic>
<script type="text/javascript"> FB.init("apikey", "appetibile/xd_receiver.htm"); </script>
[edit] problems with pic
All of the profile images in my app have suddenly become the silhouette as well. Have no idea why, but it would be great if this were not the case..
- Please file a bug and include any relevant code and a URL where this can be reproduced. Thanks, Pete (563683308 11:53, 22 April 2009 (PDT))
[edit] Same problem with silhuoette in profile-pic
All profile-pic in the application become default silhouette when being in iframe. It shows normal in fbml mode. Does somebody knows how to correct this? or is it an inner bug?
- I've seen the same thing. I found that if an exception is thrown before the DOM finishes loading (e.g. in a script tag in the body) then none of the tags are rendered. The silhouette is what you get when FB doesn't get a chance to redraw that tag. Chances are this is what is happening. In my case it was the FB.init call that was throwing an exception and putting a try/catch around it at least kept the JavaScript processor running. Using Firebug will let you step through the initialization code and also subsequent code to see what is happening.
[edit] can profile-pic be set?
I'd like to make an FB application that sets the profile pic whenever a user logs onto their FB home. E.g., to cycle through pic of an album for the profile picture - just to make it interesting ;-) Is this possible? If so, could someone point me to the docs where setting the profile pic is explained. Regards, Hudson
- Thanks for the suggestion, Hudson, but currently you can't set a user's profile picture. Normally, you'd use photos.upload to upload a photo to a user's profile, but you can't upload to the profile pic album. (you also need the photo_upload extended permission. Pete (563683308 15:02, 9 June 2009 (PDT))
[edit] error while loading page
Even though a user exists I get this annoying error message:
Errors while loading page from application
Runtime errors:
fb:profile-pic: Invalid uid for fb:profile_pic (1234567890)
when using
<fb:profile-pic uid="1234567890" width="32" height="32" linked="true" />
If I go to the FBML Test Console and enter the same it shows the image.
If I click on the image in the Test Console, I get
Profile Unavailable
Sorry, this profile is not available at the moment. Please try again shortly.
How can I catch these users? How can I prevent thie error message???
Thanks, Mike
- Is the user's privacy set to prevent you from seeing the pic? Pete -- 563683308 10:59, 6 October 2009 (PDT)
Thanks for the move and comment Pete!
No. I am selcting data from the profile table EXCLUDING users who have either name 'Facebook User' or pic '...t_silhouette.jpg'
Anyways, would I be able to see the users pic in the FBML Test Console if his privacy settings forbad it? I doubt that...
I read somewhere that this can happen when the user is updating his profile - I could live with that but then I would need some way to catch this (temporary?) behaviour.
Ideas?
TNX
M
- Mike, true about the console -- it respects privacy so it won't display a user's pic if the user hides it from your view. Anyway, after talking about it here, this error probably occurs when a user database is unavailable. We're adding this to the list of things to fix. Thanks for reporting, Pete -- 563683308 14:10, 6 October 2009 (PDT)
Thank you Pete. In the meantime, any advice on how I could catch this error? Mike --569777421 07:30, 8 October 2009 (PDT)
