View Source Appwrite.Services.Avatars (appwrite v0.1.5)

The Avatars service aims to help you complete everyday tasks related to your app image, icons, and avatars.

The Avatars service allows you to fetch country flags, browser icons, payment methods logos, remote websites favicons, generate QR codes, and manipulate remote images URLs.

All endpoints in this service allow you to resize, crop, and change the output image quality for maximum performance and visibility in your app.

Status: In Testing

Summary

Functions

Link to this function

get_browser(client, code, width \\ nil, height \\ nil, quality \\ nil)

View Source
@spec get_browser(
  Appwrite.Types.Client.t(),
  String.t(),
  integer() | nil,
  integer() | nil,
  integer() | nil
) :: String.t()

Get browser icon.

Fetches the browser icon using the provided code and optional size and quality parameters.

Parameters

  • client (Client.t): The Appwrite client instance.
  • code (String.t): The browser code.
  • width (integer): The width of the icon.
  • height (integer): The height of the icon.
  • quality (integer): The quality of the icon.

Returns

  • The browser icon URL as a string.

Raises

  • AppwriteException if any required parameter is missing.
Link to this function

get_credit_card(client, code, width \\ nil, height \\ nil, quality \\ nil)

View Source
@spec get_credit_card(
  Appwrite.Types.Client.t(),
  String.t(),
  integer() | nil,
  integer() | nil,
  integer() | nil
) :: String.t()

Get credit card icon.

Fetches the credit card provider's icon using the provided code and optional size and quality parameters.

Parameters

  • client (Client.t): The Appwrite client instance.
  • code (String.t): The credit card code.
  • width (integer): The width of the icon.
  • height (integer): The height of the icon.
  • quality (integer): The quality of the icon.

Returns

  • The credit card icon URL as a string.

Raises

  • AppwriteException if any required parameter is missing.
Link to this function

get_favicon(client, url)

View Source
@spec get_favicon(Appwrite.Types.Client.t(), String.t()) :: String.t()

Fetches the favicon of a given URL.

Parameters

  • url (string): The URL of the remote website.

Returns

  • String.t: The URI for fetching the favicon.

Raises

  • AppwriteException if the url is nil.
Link to this function

get_flag(client, code, width \\ nil, height \\ nil, quality \\ nil)

View Source
@spec get_flag(Appwrite.Types.Client.t(), String.t(), integer(), integer(), integer()) ::
  String.t()

Fetches a country flag icon by its ISO 3166-1 code.

Parameters

  • client (Client.t): The client instance.
  • code (string): ISO 3166-1 2-letter country code.
  • width (optional, integer): The width of the flag icon.
  • height (optional, integer): The height of the flag icon.
  • quality (optional, integer): The image quality percentage.

Returns

  • String.t: The URI for fetching the country flag.

Raises

  • AppwriteException if the code is nil.
Link to this function

get_image(client, url, width \\ nil, height \\ nil)

View Source
@spec get_image(Appwrite.Types.Client.t(), String.t(), integer(), integer()) ::
  String.t()

Fetches and optionally crops a remote image by URL.

Parameters

  • client (Client.t): The client instance.
  • url (string): The URL of the remote image.
  • width (optional, integer): The width to crop the image.
  • height (optional, integer): The height to crop the image.

Returns

  • String.t: The URI for fetching the cropped image.

Raises

  • AppwriteException if the url is nil.
Link to this function

get_initials(client, name \\ nil, width \\ nil, height \\ nil, background \\ nil)

View Source
@spec get_initials(
  Appwrite.Types.Client.t(),
  String.t(),
  integer(),
  integer(),
  String.t()
) ::
  String.t()

Generates a user initials avatar.

Parameters

  • client (Client.t): The client instance.
  • name (optional, string): The name or initials of the user.
  • width (optional, integer): The width of the avatar.
  • height (optional, integer): The height of the avatar.
  • background (optional, string): The background color for the avatar.

Returns

  • String.t: The URI for fetching the initials avatar.
Link to this function

get_qr(client, text, size \\ nil, margin \\ nil, download \\ nil)

View Source
@spec get_qr(Appwrite.Types.Client.t(), String.t(), integer(), integer(), boolean()) ::
  String.t()

Generates a QR code from the given text.

Parameters

  • client (Client.t): The client instance.
  • text (string): The text to encode in the QR code.
  • size (optional, integer): The size of the QR code.
  • margin (optional, integer): The margin around the QR code.
  • download (optional, boolean): Whether to download the QR code as an image.

Returns

  • String.t: The URI for fetching the QR code.

Raises

  • AppwriteException if the text is nil.