#!/bin/bash

# Create WordPress.org assets directory if it doesn't exist
mkdir -p .wordpress-org

# Check if ImageMagick is installed
if ! command -v magick &> /dev/null; then
    echo "Error: ImageMagick is not installed. Please install it first."
    echo "macOS: brew install imagemagick"
    echo "Ubuntu/Debian: sudo apt-get install imagemagick"
    exit 1
fi

# Convert SVG icon to required formats
echo "Converting SVG icon to PNG formats..."
magick -background none -density 300 assets/images/logo.svg -resize 128x128 .wordpress-org/icon-128x128.png
magick -background none -density 600 assets/images/logo.svg -resize 256x256 .wordpress-org/icon-256x256.png

echo "Icons created successfully!"
echo ""
echo "IMPORTANT: You still need to create banner images for your plugin."
echo "Create the following files in the .wordpress-org directory:"
echo "- banner-772x250.png (or .jpg)"
echo "- banner-1544x500.png (or .jpg)"
echo ""
echo "You can use tools like Canva, Photoshop, or GIMP to create these banners."
echo "The recommended dimensions are 772x250px for standard and 1544x500px for retina displays." 