Skill Level: 
Intermediate

The link to get a person's avatar from directory is located at https://directory.unl.edu/avatar/{Person's UID}/. This link will redirect you to the corresponding image file for that person's avatar image, as a bonus this will automatically manage the cache versioning for when the person updates their avatar. If the user does not have a avatar image set it will return a JPEG version of the default image (This format for the default image is being limited due to our use of Gravatar).

From there there are many options that can be added as a URL query string. An example url with all the options is https://directory.unl.edu/avatar/{Person's UID}/?s=800&dpi=144&format=JPEG&cropped=true, however these options can be customized to fit your needs.

OptionURL ParamDefault ValuePossible ValuesDescription
Sizes100topbar, tiny, small, medium, large,
800, 400, 240, 200, 120, 100, 72, 48,
40, 24, 16
Size of the avatar image
DPIdpi72144, 72The resolution of the avatar image (DPI not dimension)
FormatformatJPEGJPEG, AVIFThe format of the avatar image
Croppedcroppedtruetrue, falseWhether we want to get the cropped image or the original

Contributed By: 
Thomas Neumann