OgEx.Image.Source (og_ex v0.2.0)

Copy Markdown View Source

Normalized description of an image source.

Sources are produced by OgEx.Image.normalize/2; applications normally pass strings or {:private, path} tuples rather than constructing this struct.

:reference retains the source identity used by metadata or generated HTML. :path is populated only after a local source has been constrained to its trusted root. The remaining optional fields allow loaders to attach verified metadata without changing the source type.

Summary

Types

source_type()

@type source_type() :: :public | :private | :remote | :data

t()

@type t() :: %OgEx.Image.Source{
  bytes: binary() | nil,
  content_type: String.t() | nil,
  fingerprint: String.t() | nil,
  format: atom() | nil,
  height: pos_integer() | nil,
  path: String.t() | nil,
  reference: String.t(),
  type: source_type(),
  width: pos_integer() | nil
}