// app/gallery/page.tsx import fs from 'fs'; import path from 'path'; import sizeOf from 'image-size'; import PhotoGallery from '@/app/components/PhotoGallery'; async function getImages() { const galleryDir = path.join(process.cwd(), 'public/gallery'); const files = fs.readdirSync(galleryDir); const images = files .filter((file) => file.endsWith('.jpg') || file.endsWith('.png') || file.endsWith('.jpeg')) .map((file) => { const filePath = path.join(galleryDir, file); const buffer = fs.readFileSync(filePath); const dimensions = sizeOf(buffer); return { src: `/gallery/${file}`, width: dimensions.width || 1000, height: dimensions.height || 1000, name: file, }; }); return images; } export default async function GalleryPage() { const images = await getImages(); return (
{/* 1. Background Ambient Glow */}
{/* 2. Modernized Header */}

Gallery

Photography Collection

A curated collection of photograps. Finding the best subjects to capture, from natural landscapes to the night sky.

{/* 3. The Gallery Grid */}
); }