The <tt>s</tt> or <tt>size</tt> is the size (height and width are the same) of the image in pixels. Acceptable values range from **1** to **512**.
## Default URL for missing images
If you would like to specify a default "missing image" picture for email addresses which are not found in the Libravatar database, you may specify the URL of an image to redirect to:
Note that if an image is not found in the Libravatar database and the hash algorithm used was **MD5**, then Libravatar will first redirect to Gravatar in case the image exists there. Then it will honour the <tt>default</tt> parameter.
# For Gravatar users
As you can see, our API is heavily based on the [Gravatar API](http://en.gravatar.com/site/implement/). If your application or website already supports [Gravatar](http://www.gravatar.com) switching to the basic Libravatar service is just a matter or changing the base URL:
Note that Libravatar does **not** support the <tt>rating</tt> (or simply <tt>r</tt>) parameter since we require all images to be G-rated.
# Federated servers
In order to support domain name owners who choose to [run their own instances](running your own) of Libravatar, you must perform a DNS query to lookup the appropriate base URL for each domain (the domain is extracted from email addresses or OpenID URLs).
DNS host names:
* HTTP
*`SRV _avatars._tcp.EMAILDOMAIN`
* HTTPS
*`SRV _avatars-sec._tcp._tcp.EMAILDOMAIN`
You will probably want to use an [existing library](libraries) for this, but here's how to do that DNS lookup on a UNIX command line:
$ dig +short SRV _avatars._tcp.example.com
0 0 80 avatars.example.com.
We also provide a [domain check tool](https://www.libravatar.org/tools/check_domain) to help in your testing.
Notes for advanced users / library authors:
* Libravatar clients only consider servers listed in the highest SRV priority.
* They do however honour relative weights.
* SRV records are cached for at least 1 day (or more if the TTL is greater than 1 day).
***Make sure you sanitize the results you get from the DNS resolver** (see [Perl](https://github.com/schwern/gravatar-url/commit/14b0c613f434d2513f8f4609a17aff4fe31c17ea) and [Python](http://bazaar.launchpad.net/~libravatar/pylibravatar/trunk/revision/5) examples).
# HTTPS support
If your application is delivered over a secure (HTTPS) connection, you may want to use our HTTPS image servers to avoid triggering browser warnings about mixed HTTP/HTTPS content.
When looking up the base URL to use via DNS, replace <tt>\_avatars._tcp.example.com</tt> with:
_avatars-sec._tcp.example.com
# OpenID support
In addition to email addresses, Libravatar allows users to associate photos to their OpenIDs.
The same 5 steps apply:
1. Take a user's OpenID URL as entered by them.
2. Convert the **protocol and hostname parts** of the URL to lowercase. e.g. HTTP://UserName:Password@EXAMPLE.COM/ID/Bob => http://UserName:Password@example.com/ID/Bob
3. Compute the hash (using the **SHA256 hash algorithm only**).
4. Turn the image into a URL by prefixing it with the Libravatar base URL.
5. Put the image into an <tt>img</tt> tag on your page.
Therefore, if you don't have an email address for some of your users but you do have OpenID URLs, here is sample Python code to produce a hash for them: