Skip to content

Commit b3dc7e0

Browse files
calderbuildclaude
andcommitted
fix(image): 排除外部头像图片的懒加载处理
- GitHub头像被ImageOptimizer错误处理导致grayscale滤镜 - 跳过github.com和githubusercontent.com的图片 - 跳过.short-about内的头像图片 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 4b36548 commit b3dc7e0

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

js/image-optimization.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,16 @@
7070
processImage: function(img) {
7171
// Skip if already processed
7272
if (img.hasAttribute('data-lazy-processed')) return;
73-
73+
74+
// Skip external images like GitHub avatars - they should load directly
75+
const src = img.getAttribute('src') || '';
76+
if (src.indexOf('github.com') !== -1 ||
77+
src.indexOf('githubusercontent.com') !== -1 ||
78+
img.closest('.short-about')) {
79+
img.setAttribute('data-lazy-processed', 'true');
80+
return; // Don't process external avatar images
81+
}
82+
7483
img.setAttribute('data-lazy-processed', 'true');
7584

7685
// Set up lazy loading attributes if not present

0 commit comments

Comments
 (0)