package utils

import "strings"

func ParseBase64ImageString(input string) (contentType string, data string) {
	parts := strings.Split(input, ",")
	if len(parts) < 2 {
		panic("Invalid Base64 image string")
	}

	contentTypePart := strings.TrimSpace(parts[0])
	contentTypeParts := strings.Split(contentTypePart, ";")
	contentType = strings.TrimSpace(contentTypeParts[0])

	data = parts[1]
	return contentType, data
}
