# @happyvertical/smrt-assets-local

Local processing adapter for the SMRT asset runtime.

## Purpose

This package handles asset work that does not require a MAM or cloud processor.

Use it for local image metadata extraction, EXIF normalization, auto-orientation, dimensions, and standard image variants.

It is the lightweight default adapter for apps that need practical image handling without Ergot.

It should remain optional so `@happyvertical/smrt-assets` core stays free of Sharp and EXIF dependencies.

## Runtime Role

Register this adapter with the SMRT asset runtime when local processing is acceptable for the deployment environment.

The adapter should implement provider capabilities such as `processAsset` and `ensureVariant`.

It should not own asset identity, tenant policy, or publishing decisions.

Those belong in `@happyvertical/smrt-assets` and the host app.

## Image Metadata

Metadata extraction must normalize orientation before reporting dimensions.

Captured time should be stored in a stable ISO format when present.

GPS coordinates should be converted to decimal latitude and longitude.

Do not round GPS data aggressively; nearby-photo search depends on precision.

Store extraction results in SMRT asset metadata using exported conventions from `@happyvertical/smrt-assets`.

## Variants

Standard variants should use the shared SMRT names: `thumb`, `card`, `preview`, and `publish`.

Variant generation should be deterministic for the same source version and request parameters.

Prefer cache reuse when a matching derived asset already exists.

Variant assets should preserve parent or lineage metadata back to the source asset.

Generated bytes are local outputs; callers may still choose to sync them to Ergot later.

## Dependency Notes

Sharp belongs in this package, not in `@happyvertical/smrt-assets` core.

Any additional EXIF dependency should stay here unless the core type contract truly needs it.

Tests should build tiny fixture images in memory where possible.

Avoid checked-in large binary fixtures.

## Gotchas

Do not add Ergot-specific behavior here.

Do not call dashboard APIs from this package.

Do not silently drop extraction failures; return status and error metadata so hosts can decide what to display.

Keep the provider deterministic enough for CI and local development to agree.
