// Adds or removes a ICC, IPTC, or generic profile from an image. If the
// profile is empty, it is removed from the image otherwise added. Use a name
// of '*' and an empty profile to remove all profiles from the image.
//
// name: Name of profile to add or remove: ICC, IPTC, or generic profile.
//
func (mw *MagickWand) ProfileImage(name string, profile []byte) error {
	csname := C.CString(name)
	defer C.free(unsafe.Pointer(csname))
	if profile == nil {
		C.MagickProfileImage(mw.mw, csname, unsafe.Pointer(nil), C.size_t(0))
	} else {
		C.MagickProfileImage(mw.mw, csname, unsafe.Pointer(&profile[0]), C.size_t(len(profile)))
	}
	return mw.GetLastError()
}
Example #2
0
// Adds or removes a ICC, IPTC, or generic profile from an image. If the
// profile is empty, it is removed from the image otherwise added. Use a name
// of '*' and an empty profile to remove all profiles from the image.
//
// name: Name of profile to add or remove: ICC, IPTC, or generic profile.
//
func (mw *MagickWand) ProfileImage(name string, profile []byte) error {
	csname := C.CString(name)
	defer C.free(unsafe.Pointer(csname))
	ok := C.MagickProfileImage(mw.mw, csname, unsafe.Pointer(&profile[0]), C.size_t(len(profile)))
	return mw.getLastErrorIfFailed(ok)
}