#!/bin/bash

if ! command -v cwebp &> /dev/null; then
    echo "Error: cwebp is not installed"
    exit 1
fi

for img in "src/assets/repair-logs"/*.{jpg,jpeg,png}; do
    # Convert to WebP
    cwebp -q 80 "$img" -o "${img%.*}.webp"
    
    rm "$img"
done