FVN.li Documentation Help

games:process-screenshots

Processes and optimizes game screenshots for web display.

Overview

This command processes game screenshots by converting them to optimized WebP format, resizing them for consistent display, and generating thumbnails. It helps improve website performance by reducing image file sizes while maintaining visual quality.

Key Features: WebP conversion, quality optimization, batch processing, memory-efficient handling.

Usage

php artisan games:process-screenshots [options]

Options

--force

Process screenshots even if they already exist.

--game-id=ID

ID of the specific game to process.

--game-name=NAME

Name (or part of name) of the game(s) to process.

--all

Process all visible games with screenshots.

--quality=QUALITY

WebP quality (0-100) (default: 80).

Processing Logic

The command follows this workflow:

  1. Identifies games with screenshots to process

  2. Downloads original images if not already cached

  3. Converts to WebP format with specified quality

  4. Resizes images to standard dimensions

  5. Generates thumbnails for gallery views

  6. Optimizes file sizes while preserving quality

  7. Updates database records with processed image paths

Examples

php artisan games:process-screenshots --game-id=123

Processes screenshots for game ID 123.

php artisan games:process-screenshots --game-id=123 --quality=90

Processes with higher quality settings (larger files).

php artisan games:process-screenshots --game-id=123 --force

Reprocesses screenshots even if they already exist.

php artisan games:process-screenshots --all

Processes screenshots for all games (may take considerable time).

When to Use

Recommended Usage Scenarios

  1. After importing new games with screenshots

  2. When optimizing website performance

  3. After changing image quality settings

  4. During initial setup or migration

  5. When storage space needs optimization

Image Processing

The command performs several image optimizations:

Format Conversion

  • WebP Output: Modern format with superior compression

  • Quality Control: Configurable quality vs. file size balance

  • Fallback Support: Maintains compatibility with older browsers

Size Optimization

  • Standard Dimensions: Consistent sizing for layout

  • Responsive Variants: Multiple sizes for different displays

  • Thumbnail Generation: Small previews for galleries

Quality Enhancement

  • Sharpening: Improves clarity after resizing

  • Color Optimization: Maintains color accuracy

  • Compression: Reduces file size without visible quality loss

Performance Considerations

Factor

Impact

Mitigation

Memory Usage

High for large images

Process in batches

Processing Time

Varies by image count

Run during off-peak hours

Storage Space

Temporary increase during processing

Monitor disk space

Network Bandwidth

Downloads original images

Consider bandwidth limits

Quality Settings

Different quality settings provide different trade-offs:

Quality 60-70

  • Use Case: Maximum compression for bandwidth-limited environments

  • File Size: Smallest files

  • Visual Quality: Acceptable for thumbnails

Quality 80 (Default)

  • Use Case: Balanced compression for general use

  • File Size: Good compression ratio

  • Visual Quality: High quality for most purposes

Quality 90-100

  • Use Case: Maximum quality for detailed screenshots

  • File Size: Larger files

  • Visual Quality: Excellent for detailed viewing

Error Handling

The command handles various error conditions:

  • Download Failures: Retry logic for network issues

  • Invalid Images: Skip corrupted or unsupported files

  • Processing Errors: Continue with remaining images

  • Storage Issues: Handle disk space and permission problems

Output Formats

The processing generates multiple image variants:

Full Size Images

  • Format: WebP with specified quality

  • Dimensions: Optimized for detail viewing

  • Use: Game detail pages and lightboxes

Medium Images

  • Format: WebP with balanced compression

  • Dimensions: Suitable for gallery displays

  • Use: Screenshot galleries and previews

Thumbnails

  • Format: WebP with higher compression

  • Dimensions: Small previews

  • Use: Game cards and quick previews

Storage Organization

Processed images are organized efficiently:

storage/ ├── screenshots/ │ ├── full/ │ │ └── game-123-screenshot-1.webp │ ├── medium/ │ │ └── game-123-screenshot-1.webp │ └── thumbnails/ │ └── game-123-screenshot-1.webp
Last modified: 01 June 2025