Libravatar::URL - Make URLs for Libravatars from an email address


    use Libravatar::URL;

    my $url = libravatar_url( email => '' );


See for more information.



    # By email
    my $url = libravatar_url( email => $email, %options );

    # By OpenID
    my $url = libravatar_url( openid => $openid, %options );

Constructs a URL to fetch the Libravatar for the given $email address or $openid URL.

%options are optional. libravatar_url will accept all the options of "gravatar_url" in Gravatar::URL except for rating and border.

The available options are...


Specifies the desired width and height of the avatar (they are square).

Valid values are from 1 to 512 inclusive. Any size other than 80 may cause the original image to be downsampled using bicubic resampling before output.

    size    => 40,  # 40 x 40 image


The url to use if the user has no avatar.

    default => ""

Relative URLs will be relative to the base (ie., not your web site.

Libravatar defines special values that you may use as a default to produce dynamic default images. These are "identicon", "monsterid", "wavatar" and "retro". "404" will cause the URL to return an HTTP 404 "Not Found" error instead and "mm" will display the same "mystery man" image for everybody. See for more info.

If omitted, Libravatar will serve up their default image, the orange butterfly.


This is the URL of the location of the Libravatar server you wish to grab avatars from. Defaults to for HTTP and for HTTPS.


If true, use short key names when constructing the URL. "s" instead of "size", "d" instead of "default" and so on.

short_keys defaults to true.


If true, serve avatars over HTTPS instead of HTTP.

You should select this option if your site is served over HTTPS to avoid browser warnings about the presence of insecure content.

https defaults to false.


Copyright 2011, Francois Marier <>.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


SEE ALSO - The Libravatar web site - The Libravatar API documentation