| ํญ๋ชฉ | ๋ด์ฉ |
|---|---|
| Invoke | /inspector:image |
| Category | kobic-development |
| Complexity | simple |
| MCP Servers | flutter-inspector |
/inspector:image โ ์ด๋ฏธ์ง ๋ฉ๋ชจ๋ฆฌ ์ง๋จ#
ํ๋ง๋๋ก#
์ฑ์ด ๋ณด์ฌ์ฃผ๋ ์ฌ์ง๋ค์ด ๋ฉ๋ชจ๋ฆฌ๋ฅผ ์ผ๋ง๋ ์ก์๋จน๊ณ ์๋์ง ๋ค์ฌ๋ค๋ณด๋ ์ฒญ์ง๊ธฐ์ ๋๋ค. ๋์ฅ๊ณ ์ ์์์ด ๋๋ฌด ๊ฝ ์ฐผ๋์ง, ์ํ ๊ฒ ์๋์ง ์ด์ด๋ณด๊ณ ์ ๋ฆฌํด ์ฃผ๋ ๊ฒ๊ณผ ๊ฐ์์.
๋๊ฐยท์ธ์ ์ฐ๋์#
- ์ฑ์ด ๊ฐ์๊ธฐ ๋๋ ค์ง๊ฑฐ๋ "๋ฉ๋ชจ๋ฆฌ ๋ถ์กฑ" ๊ฒฝ๊ณ ๊ฐ ๋ฐ ๋
- ์ด๋ฏธ์ง๊ฐ ์ ์ ๋จ๊ฑฐ๋ ๋ก๋ฉ์ด ๋ต๋ตํ๊ฒ ๋๋ฆด ๋
- ์ฌ์ง์ด ๋ง์ด ๋ค์ด๊ฐ ํ๋ฉด์์ ์ฑ์ด ๋ฉ์ถ๊ฑฐ๋ ๊บผ์ง ๋(๋ฉ๋ชจ๋ฆฌ ์ด๊ณผ)
๋ฌด์์ ํด์ฃผ๋์#
- ์ง๊ธ ์ด๋ฏธ์ง ์บ์๊ฐ ์ผ๋ง๋ ์ฐจ ์๋์ง(์: 100MB ์ค 50MB ์ฌ์ฉ, 50%)์ ์ ์ฒด ๋ฉ๋ชจ๋ฆฌ ์ฌ์ฉ๋์ ์๋ ค์ค๋๋ค.
- ๋ฌธ์ ๊ฐ ๋ ๋งํ ์ด๋ฏธ์ง๋ฅผ ์ฐพ์๋ด๊ณ ์ ์(์: 65์ , C๋ฑ๊ธ)์ ๊ฐ์ ์ ์์ ์ค๋๋ค. (์: "์ด ์ด๋ฏธ์ง๋ ํ๋ฉด ํฌ๊ธฐ๋ณด๋ค 4๋ฐฐ ํฝ๋๋ค" โ ํฌ๊ธฐ๋ฅผ ์ค์ฌ ์ฐ๋ผ๋ ์ ์)
- ์์ธ ์บ์๋ฅผ ๋น์์ ๋ฉ๋ชจ๋ฆฌ๋ฅผ ๋ค์ ํ๋ณดํด ์ค๋๋ค.
์ด๋ป๊ฒ ์ฐ๋์#
# ์ง๊ธ ์บ์ ์ํ ํ์ธ
/inspector/image stats
# ๋ฌธ์ ์๋ ์ด๋ฏธ์ง ๋ถ์
/inspector/image warnings
# ๋ง๋ฃ๋ ์บ์ ๋น์ฐ๊ธฐ
/inspector/image clear expired
clear ๋ค์๋ ๋น์ธ ๋์์ ๊ณจ๋ผ ์ธ ์ ์์ต๋๋ค: all(์ ์ฒด) / memory(๋ฉ๋ชจ๋ฆฌ) / disk(๋์คํฌ) /
expired(๋ง๋ฃ๋ ๊ฒ).
์์์ ๋ฌด์จ ์ผ์ด ๋ฒ์ด์ง๋์#
์ํฉ๋ณ๋ก ์๋ ์์๋๋ก ์ ๊ฒํฉ๋๋ค.
- ๋ฉ๋ชจ๋ฆฌ ๊ฒฝ๊ณ ๊ฐ ๋ด์ ๋: ํ์ฌ ์ฌ์ฉ๋ ํ์ธ โ ๋ฌธ์ ์ด๋ฏธ์ง ์ฐพ๊ธฐ โ ์บ์ ๋น์ฐ๊ธฐ โ ์ด๋ฏธ์ง ํฌ๊ธฐ ์ค์ด๊ธฐ(cacheWidth/cacheHeight) ๊ฒํ
- ์ด๋ฏธ์ง ๋ก๋ฉ์ด ๋๋ฆด ๋: ์บ์ ์ ์ค๋ฅ ํ์ธ โ ๋คํธ์ํฌ ๋ค์ด๋ก๋ ์ ๊ฒ โ ์ด๋ฏธ์ง ์ฉ๋ ์ต์ ํ ๊ฒํ
- ์ฑ์ด ๋ฉ๋ชจ๋ฆฌ ์ด๊ณผ๋ก ๊บผ์ง ๋: ์ต๋ ๋ฉ๋ชจ๋ฆฌ ํ์ธ โ ๋๋ฌด ํฐ ์ด๋ฏธ์ง ์ฐพ๊ธฐ โ ํฐ ์ด๋ฏธ์ง ์ต์ ํ โ ์ต๋ ์บ์ ํฌ๊ธฐ ์กฐ์ ๊ฒํ
โ๏ธ ์์ธ ์ต์ ยท์คํ ๋ช ์ธ (๊ฐ๋ฐ์ / AI ์์ด์ ํธ์ฉ)
Triggers#
- Image cache issues
- Memory usage warnings
- Image loading performance
MCP Tools#
img_get_cache_stats#
Returns image cache statistics.
Response example:
{
" cache " : {
" currentSize " : 52428800,
" currentSizeFormatted " : " 50 MB " ,
" maximumSize " : 104857600,
" maximumSizeFormatted " : " 100 MB " ,
" usagePercent " : 50,
" liveImageCount " : 25
},
" memory " : {
" currentUsage " : 157286400,
" currentUsageFormatted " : " 150 MB "
}
}img_analyze_warnings#
Analyzes image-related warnings and issues.
Parameters:
threshold: Warning threshold (MB)
Response example:
{
" warnings " : [
{
" type " : " oversized " ,
" severity " : " high " ,
" message " : " Image is 4x larger than display size " ,
" image " : " banner_home.png " ,
" suggestion " : " Recommend using cacheWidth/cacheHeight "
}
],
" score " : 65,
" grade " : " C "
}img_clear_cache#
Clears the image cache.
Parameters:
type: Clear type (all, memory, disk, expired)
Common Diagnostics#
Memory warning#
1. img_get_cache_stats - > Check current usage
2. img_analyze_warnings - > Identify problematic images
3. img_clear_cache - > Clear cache
4. Consider applying cacheWidth/cacheHeightSlow image loading#
1. img_get_cache_stats - > Check cache hit rate
2. /inspector/network - > Check downloads
3. Review image size optimizationApp crash (OOM)#
1. img_get_cache_stats - > Check peak memory
2. img_analyze_warnings - > Find oversized images
3. Apply large image optimization
4. Consider adjusting maximum cache sizeBest Practices#
Image Loading Patterns#
// CORRECT: Specify cache size
Image.network(
imageUrl,
cacheWidth: 200,
cacheHeight: 200,
)
// CORRECT: Use CachedNetworkImage
CachedNetworkImage(
imageUrl: imageUrl,
memCacheWidth: 200,
placeholder: (context, url) => CircularProgressIndicator(),
)
// WRONG: Loading at original size
Image.network(imageUrl) // 4000x4000 image displayed at 100x100
Examples#
Check cache status#
/inspector/image statsAnalyze image issues#
/inspector/image warningsClear cache#
/inspector/image clear expiredReferences#
- Detailed implementation:
.claude/agents/flutter-inspector-image.md - Master inspector:
.claude/commands/inspector.md - Image optimization:
.claude/agents/flutter-image-optimizer.md