{"record":{"id":"ad139e6b3bd454e2","repo":"siyuan-note/siyuan","slug":"invalid-video-poster-w","errorCode":null,"errorMessage":"invalid video poster: %w","messagePattern":"invalid video poster: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/boot_appearance.go","lineNumber":473,"sourceCode":"\t\tif layer == nil || !isValidBootAppearanceID(layer.ID) || layerIDs[layer.ID] {\n\t\t\terr = errors.New(\"invalid or duplicate layer ID\")\n\t\t\treturn nil, err\n\t\t}\n\t\tlayerIDs[layer.ID] = true\n\t\tif layer.Type != \"image\" && layer.Type != \"video\" {\n\t\t\terr = fmt.Errorf(\"unsupported layer type [%s]\", layer.Type)\n\t\t\treturn nil, err\n\t\t}\n\t\tif _, _, err = validateBootAppearanceResource(pluginDir, appearanceDir, layer.Src, layer.Type); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid layer source: %w\", err)\n\t\t}\n\t\tif layer.Type == \"video\" {\n\t\t\tif layer.Poster == \"\" {\n\t\t\t\terr = errors.New(\"video poster is required\")\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif _, _, err = validateBootAppearanceResource(pluginDir, appearanceDir, layer.Poster, \"image\"); err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid video poster: %w\", err)\n\t\t\t}\n\t\t} else if layer.Poster != \"\" {\n\t\t\terr = errors.New(\"image layer cannot declare a poster\")\n\t\t\treturn nil, err\n\t\t}\n\t\tfit := layer.Fit\n\t\tif fit == \"\" {\n\t\t\tfit = \"cover\"\n\t\t}\n\t\tif !isValidBootAppearanceFit(fit) {\n\t\t\terr = fmt.Errorf(\"invalid layer fit [%s]\", fit)\n\t\t\treturn nil, err\n\t\t}\n\t\tposition := layer.Position\n\t\tif position == \"\" {\n\t\t\tposition = \"center\"\n\t\t}\n\t\tif !isValidBootAppearancePosition(position) {","sourceCodeStart":455,"sourceCodeEnd":491,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/boot_appearance.go#L455-L491","documentation":"The poster declared on a video layer is validated with validateBootAppearanceResource using the \"image\" type: it must exist inside the appearance directory, be a symlink-free relative path, have an image extension, and respect size limits. Failures are wrapped as \"invalid video poster\".","triggerScenarios":"A video layer's poster path in manifest.json references a missing file, escapes the appearance directory, uses a non-image extension (e.g. .mp4), or exceeds the size limit.","commonSituations":"Poster image not packaged with the plugin; poster path typo; pointing the poster at the video file itself; oversized poster screenshot from a retina capture.","solutions":["Ensure the poster file exists in the appearance directory and is included in the package.","Make the poster a relative path to an actual image file (.png/.jpg etc.), not a video or document.","Compress the poster image if it exceeds the resource size limit."],"exampleFix":"// before: manifest.json\n{\"id\":\"intro\",\"type\":\"video\",\"src\":\"intro.mp4\",\"poster\":\"intro.mp4\"}\n// after\n{\"id\":\"intro\",\"type\":\"video\",\"src\":\"intro.mp4\",\"poster\":\"intro.png\"}","handlingStrategy":"validation","validationCode":"for (const l of manifest.layers) {\n  if (l.type === 'video' && l.poster) {\n    const p = path.resolve(appearanceDir, l.poster);\n    if (!fs.existsSync(p) || !/\\.(png|jpe?g|webp)$/i.test(l.poster)) throw new Error('bad poster: ' + l.poster);\n  }\n}","typeGuard":null,"tryCatchPattern":"try { loadAppearance(id); } catch (e) { if (/invalid video poster/.test(String(e))) { /* point poster at a real, in-directory image file */ } }","preventionTips":["Point poster at an actual image, never the video itself","Include poster files in the packaged plugin","Keep posters reasonably sized"],"tags":["boot-appearance","video","poster","resource-validation"],"backgroundTag":"file-not-found","analyzedSha":"9f775e8a12daef8255556097396f9b2739078892","analyzedAt":"2026-09-19T03:17:15.984Z","contentChangedAt":"2026-09-19T03:17:15.984Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}