package main

import (
	"encoding/base64"
	"io/ioutil"
	"strings"
)

var _cmykProfilePath string
var cmykProfile64 = `
[encoded data, 1302210 characters]
DQoNCg0KDQoNCgAA
`

func cmykProfilePath() (string, error) {
	if _cmykProfilePath == "" {
		cmykProfile, _ := base64.StdEncoding.DecodeString(strings.Replace(cmykProfile64, "\n", "", -1))

		f, err := ioutil.TempFile("", "")
		if err != nil {
			return "", err
		}

		f.Write(cmykProfile)
		f.Close()

		_cmykProfilePath = f.Name()
		logNotice("CMYK profile was written to %v", _cmykProfilePath)
	}

	return _cmykProfilePath, nil
}
