Add debugging to ScreenshotGallery component

- Add console logging for props, screenshot data, and image loading
- Add onLoad event to track successful image loads
- Add more detailed error logging for failed images
- Debug data flow to identify why gallery preview/enlargement not working
This commit is contained in:
mindesbunister
2025-07-14 01:07:23 +02:00
parent 045d4a41e3
commit 8087806a16
7 changed files with 31 additions and 24 deletions

View File

@@ -1,22 +0,0 @@
import { NextRequest, NextResponse } from 'next/server'
import fs from 'fs/promises'
import path from 'path'
export async function GET(
request: NextRequest,
context: any
) {
try {
const screenshotsDir = path.join(process.cwd(), 'screenshots')
const filePath = path.join(screenshotsDir, context.params.filename)
const file = await fs.readFile(filePath)
return new NextResponse(file, {
headers: {
'Content-Type': 'image/png',
'Content-Disposition': `inline; filename="${context.params.filename}"`
}
})
} catch (e: any) {
return NextResponse.json({ error: e.message }, { status: 404 })
}
}