Media Library DAM, AVIF/WebP Pipeline & Focal-Point Crops
Every image uploaded to Media → Library (/d-admin/upload) or POST /wp-json/wp/v2/media runs through Daypress's pure-Rust image pipeline for responsive resizing, AVIF/WebP transcoding, and zero-CLS dimension tracking.
Automatic AVIF/WebP encoding & responsive crops
- Responsive Sizes & Next-Gen Formats: Uploading a JPEG or PNG records intrinsic
widthandheight(eliminating Cumulative Layout Shift) and generatesthumbnail,medium, andlargederivatives alongside modern WebP and AVIF files underuploads/. - Immutable Edge Caching: Static media responses emit
Cache-Control: public, max-age=31536000, immutableandETagheaders for instant browser and CDN caching. - Built-in SVG Sanitizer: Uploaded
.svgvectors are parsed and stripped of<script>elements,javascript:URIs, and inlineon*event handlers before hitting disk.

Media -> Library (/d-admin/upload) organizes uploads into virtual folders without changing public /uploads/* URLs.
Virtual folders, focal-point picker, in-place replace & hygiene
- Virtual DAM Folders (
daypress_list_media_folders): Group attachments into hierarchical folders (e.g., Editorial Plates, Case Studies, Icons). Because folders are metadata-only, moving an asset never breaks existing URLs. - Interactive Focal-Point Crop Picker: Click any image in the Media Inspector to place a focal crosshair—Daypress outputs matching CSS
object-positioncoordinates so card thumbnails never crop out faces or UI subjects. - 1-Click Replace File in Place: Upload an updated screenshot or PDF directly inside an existing attachment record to regenerate all AVIF/WebP crops while keeping the exact same attachment ID and URL across every page.
- Unused Asset Scanner (
daypress_scan_unused_media): Scans allpost_content,layout_jsonAST nodes, ACF fields, and theme templates to list orphaned attachments safe for cleanup.
Uploading media programmatically (REST multipart & MCP)
# Option A: Standard WordPress REST v2 multipart upload
curl -X POST https://example.com/wp-json/wp/v2/media \
-u "admin:abcd efgh ijkl mnop" \
-F "file=@./hero-diagram.png" \
-F "alt_text=System architecture overview"
# Option B: MCP base64 upload via daypress_import_wp_bundle
# Registers the attachment in SQLite and writes /uploads/hero-diagram.pngDayStudio Image Rule:
daypress_import_html_design does not auto-download external https:// hotlinks or inline data:image/ URIs. Always upload assets to the Media Library and point AST Image nodes to /uploads/<file_name>. For S3/R2 cloud offload, see Production Hosting, TLS, R2/S3 & Hot Cache.