#!/bin/bash

# Function to rename file extensions
rename_extension() {
	local file="$1"
	local base_name="${file%.*}" # Remove the existing extension
	local new_file="${base_name}.jpg"

	# Rename the file
	if [[ "$file" != "$new_file" ]]; then
		echo "Renaming \"$file\" to \"$new_file\""
		mv "$file" "$new_file"
	fi
}

# Loop through all files in the current directory
for file in *; do
	# Check if the file has .png or .jpeg extension
	if [[ "$file" == *.png || "$file" == *.jpeg ]]; then
		rename_extension "$file"
	fi
done
