feat: photography features & image optimizations
- Hero carousel: gallery.yaml hero accepts single UUID or array, crossfade component - Full-bleed single albums: subpages with 1 album skip grid, render photos directly - EXIF on hover: camera/lens/focal length overlay on grid items (toggle via exifOnHover) - Customizable grid: columns/gap/aspectRatio/layout (masonry|uniform) via gallery.yaml - Per-subpage grid overrides: each subpage can override global grid config - True masonry: per-image aspect ratios from EXIF dimensions - next/image migration: homepage hero, album covers, grid thumbnails, about portrait - ThumbHash blur placeholders and dominant color backgrounds - Custom next/image loader via image proxy with width/quality params - Lightbox fade-in transition with dominant color background - Password-protected subpages, health check, rate limiting, OG images
This commit is contained in:
24
lib/immichLoader.ts
Normal file
24
lib/immichLoader.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
/**
|
||||
* Custom next/image loader for Immich proxy.
|
||||
*
|
||||
* Referenced by next.config.ts via images.loaderFile.
|
||||
* Generates URLs that point to our /api/image proxy route,
|
||||
* passing width and quality as query parameters.
|
||||
*
|
||||
* The src passed to next/image should already be a full proxy URL
|
||||
* (e.g. /api/image/<token>?size=preview). This loader appends
|
||||
* w and q params for responsive srcset generation.
|
||||
*/
|
||||
|
||||
'use client';
|
||||
|
||||
interface ImageLoaderParams {
|
||||
src: string;
|
||||
width: number;
|
||||
quality?: number;
|
||||
}
|
||||
|
||||
export default function immichLoader({ src, width, quality }: ImageLoaderParams): string {
|
||||
const separator = src.includes('?') ? '&' : '?';
|
||||
return `${src}${separator}w=${width}&q=${quality || 75}`;
|
||||
}
|
||||
Reference in New Issue
Block a user