OpenFresco.Sizes (open_fresco v0.1.0)

Copy Markdown View Source

Named canvas-size presets for common social-card targets. Render a responsive scene (one built with Scene.place/1 insets) at any of these with Scene.put_size/3 — or use your own dimensions; nothing here is required, render/3 accepts any canvas size.

One 1200×630 image is accepted everywhere (platforms scale/crop), so a single :og render is usually enough; the other presets are for when you want a platform-optimized variant.

Summary

Functions

Dimensions for a preset name, or nil if unknown.

The size-preset map: %{name => {width, height}}.

Resize a scene to a named preset (no-op if the name is unknown).

Functions

get(name)

@spec get(atom()) :: {pos_integer(), pos_integer()} | nil

Dimensions for a preset name, or nil if unknown.

presets()

@spec presets() :: %{required(atom()) => {pos_integer(), pos_integer()}}

The size-preset map: %{name => {width, height}}.

put(scene, name)

Resize a scene to a named preset (no-op if the name is unknown).