How to detect default avatar on the link like this: https://graph.facebook.com/'.$id.'/picture?type=large
?
Is it the only way to get avatars (male/female) from special prepared profiles and then compare by e.g. md5() ?
It's hard to believe this is the only way.
There isn't an API you can call to tell if they are using the default photo or not. Instead of downloading the whole image and checking the MD5, you could issue an HTTP HEAD request to that profile URL and look at the
Location
header and see if the URL is one of the known default profile images:Male: https://fbcdn-profile-a.akamaihd.net/static-ak/rsrc.php/v2/yL/r/HsTZSDw4avx.gif
Female (Darth Vader):https://fbcdn-profile-a.akamaihd.net/static-ak/rsrc.php/v2/yp/r/yDnr5YfbJCH.gif
These URL's could change I suppose, and so could the default photos, but I haven't seen either case happen that I can remember.