#!/bin/bash

QUELL_PROFIL="sRGB.icm"
ZIEL_PROFIL="adobeRGB.icm"

if convert "$1" "${1%.*}.icm" 2>/dev/null; then
  # wir haben ein Profil
  convert "$1" -profile "$ZIEL_PROFIL" "$2"
  rm -f "${1%.*}.icm"
else
  # wir haben kein Profil
  convert "$1" -profile "$QUELL_PROFIL" \
               -profile "$ZIEL_PROFIL" "$2"
fi
