Weave.Image (weave v0.2.50)

Copy Markdown View Source

Thumbnail processing powered by Rust.

Downloads images, resizes to 256x256 WebP thumbnails, and computes deterministic storage keys based on source URL SHA-256.

Summary

Functions

Downloads an image, resizes to 256x256 WebP, and computes the storage key.

Computes the thumbnail storage key from a source URL.

Functions

process_thumbnail(url)

Downloads an image, resizes to 256x256 WebP, and computes the storage key.

Returns {:ok, {key, webp_bytes}} or {:error, reason}.

thumbnail_key(source_url)

Computes the thumbnail storage key from a source URL.

Returns "thumbnails/{sha256_hex[0..32]}.webp".

Examples

iex> Weave.Image.thumbnail_key("https://example.com/photo.jpg")
"thumbnails/" <> _rest = Weave.Image.thumbnail_key("https://example.com/photo.jpg")