![]() MUST have a recognizable image extension (jpg, jpeg, gif, png).MUST be accessible via HTTP or HTTPS on the standard ports, 80 and 443, respectively. ![]() Default images are passed through a security scan to avoid malicious content. cannot be on an intranet, on a local development machine, behind HTTP Auth or some other firewall etc). There are a few conditions which must be met for default image URL: When you include a default image, Gravatar will automatically serve up that image if there is no image associated with the requested email hash. To URL-encode a string in PHP, you can use something like this: echo urlencode( '' ) The URL should be URL-encoded to ensure that it carries across correctly, for example: If you'd prefer to use your own default image (perhaps your logo, a funny face, whatever), then you can easily do so by supplying the URL to an image in the d= or default= parameter. What happens when an email address has no matching Gravatar image? By default, this: You may request images anywhere from 1px up to 2048px, however note that many users have lower resolution images, so requesting larger sizes may result in pixelation/low-quality images. You may request a specific image size, which will be dynamically delivered from Gravatar by using the s= or size= parameter and passing a single pixel dimension (since the images are square): jpg extension to that URL:īy default, images are presented at 80px by 80px if no size parameter is supplied. If you require a file-type extension (some places do) then you may also add an (optional). When wrapped in an IMG tag, that URL will produce: Where HASH is replaced with the calculated hash for the specific email address you are requesting. The most basic image request URL looks like this: To get an image specific to a user, you must first calculate their email hash. Gravatar images may be requested just like a normal image, using an IMG tag.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |