ImageProvider
On this page
Deterministic, synchronous delivery hooks. Ardo emits originals; a site's deploy uploads them.
import type { ImageProvider } from "ardo/config"
type ImageProvider = {
source: (input: {
/** SHA-256 of the original bytes, all 64 hexadecimal characters. */
sha256: string;
extension: string;
/** Dimensions after applying EXIF orientation. */
width: number;
height: number;
/** EXIF orientation of the original bytes. Apply it before the crop. */
orientation: number;
/** Deployment base Ardo uses for its own URLs; root-relative provider URLs must include it. */
base: string;
}) => {
fileName: string;
url: string;
};
url: (input: {
source: string;
crop: ImageCropRectangle;
width: number;
height: number;
kind: "rendition" | "fallback";
}) => {
url: string;
type: ImageMimeType;
};
};
Properties
| Name | Type | Required |
|---|---|---|
source | (input: { sha256: string; extension: string; width: number; height: number; orientation: number; base: string }) => { fileName: string; url: string } | Yes |
url | (input: { source: string; crop: ImageCropRectangle; width: number; height: number; kind: "rendition" | "fallback" }) => { url: string; type: ImageMimeType } | Yes |