{"record":{"id":"d3ecd593dfa1b9e6","repo":"babalae/better-genshin-impact","slug":"error-d3ecd5","errorCode":null,"errorMessage":"图片像素尺寸无效或超过安全限制。","messagePattern":"图片像素尺寸无效或超过安全限制。","errorType":"exception","errorClass":"InvalidDataException","httpStatus":null,"severity":"error","filePath":"BetterGenshinImpact/View/Controls/Markdown/MarkdownImageLoader.cs","lineNumber":229,"sourceCode":"                    WpfPixelFormats.Bgra32,\n                    null,\n                    pixels,\n                    image.Width * 4);\n                bitmapSource.Freeze();\n                return new MarkdownImageResult(bitmapSource, image.Width, image.Height);\n            }\n            catch (Exception imageSharpException)\n            {\n                throw new InvalidDataException(\"无法解码 Markdown 图片。\", imageSharpException);\n            }\n        }\n    }\n\n    private static void ValidatePixelCount(int width, int height)\n    {\n        if (width <= 0 || height <= 0 || (long)width * height > MaxPixelCount)\n        {\n            throw new InvalidDataException(\"图片像素尺寸无效或超过安全限制。\");\n        }\n    }\n\n    private static string GetCacheKey(Uri source)\n    {\n        if (!source.IsFile)\n        {\n            return source.AbsoluteUri;\n        }\n\n        var fileInfo = new FileInfo(source.LocalPath);\n        return fileInfo.Exists\n            ? $\"{fileInfo.FullName}|{fileInfo.LastWriteTimeUtc.Ticks}|{fileInfo.Length}\"\n            : fileInfo.FullName;\n    }\n}\n\ninternal sealed class MarkdownImagePresenter : Grid","sourceCodeStart":211,"sourceCodeEnd":247,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/View/Controls/Markdown/MarkdownImageLoader.cs#L211-L247","documentation":"Error \"图片像素尺寸无效或超过安全限制。\" thrown in babalae/better-genshin-impact.","triggerScenarios":"ValidatePixelCount 检查图片宽或高<=0，或宽×高超过 MaxPixelCount 安全上限时抛出。","commonSituations":"引用了像素尺寸异常巨大（像素炸弹）的图片。","solutions":["压缩图片尺寸使其低于安全限制","检查图片像素尺寸是否有效（大于0）","使用正常尺寸的图片替换"],"exampleFix":"缩小图片像素尺寸（如限制在合理分辨率内）后再引用。","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}