Merge pull request #1013 from willmiao/agent

Hugging Face model metadata AI enrichment
This commit is contained in:
pixelpaws
2026-07-06 12:21:19 +08:00
committed by GitHub
67 changed files with 12666 additions and 2209 deletions

View File

@@ -174,7 +174,10 @@ function renderMediaItem(img, index, exampleFiles) {
const localUrl = localFile ? localFile.path : '';
// Calculate appropriate aspect ratio
const aspectRatio = (img.height / img.width) * 100;
// Defensive fallback: 0 width/height → 4:3 default (prevents NaN layout)
const safeW = img.width || 4;
const safeH = img.height || 3;
const aspectRatio = (safeH / safeW) * 100;
const containerWidth = 800; // modal content maximum width
const minHeightPercent = 40;
const maxHeightPercent = (window.innerHeight * 0.6 / containerWidth) * 100;