Scan the current project directory to find all image files exceeding the specified dimensions or file size, and generate a detailed report.
Use Cases
- Check image assets before project optimization
- Find large-dimension images that may cause performance issues
- Find large image files that take up excessive storage space
- Audit image asset usage in the project
Execution Steps
- Use AskUserQuestion to ask the user for the threshold type to scan:
- Provide the following options:
- Scan by dimensions only (width/height)
- Scan by file size only
- Scan by both dimensions and file size
- Provide the following options:
-
Based on the user's choice, ask for the specific threshold:
- If dimension scanning is selected, provide preset options:
- 1920x1080 (Full HD)
- 2560x1440 (2K)
- 3840x2160 (4K)
- Custom
- If file size scanning is selected, provide preset options:
- 1MB
- 5MB
- 10MB
- Custom
- If dimension scanning is selected, provide preset options:
-
Based on the user's choice, execute the scan script:
- Run using Bash:
/Users/bytedance/.claude/skills/scan-large-images/scanner.sh --min-width <宽度> --min-height <高度> --min-size <大小> - Note: 5MB = 5242880 bytes
- Run using Bash:
-
Execute notification after the task is complete:
play -n synth 0.5 sine 1000-100 vol 0.2
Technical Notes
- Use macOS native
sipscommand to get image dimensions - Automatically ignore common directories: node_modules, .git, dist, build, etc.
- Supported image formats: PNG, JPG, JPEG, GIF, BMP, WebP, TIFF, ICO
- Sort the list of large images in descending order by file size
- Provide optimization suggestions