Exemplo n.º 1
0
// Associates a metadata key with its value.
func (self Canvas) SetMetadata(key string, value string) error {
	success := C.MagickSetImageProperty(self.wand, C.CString(key), C.CString(value))
	if success == C.MagickFalse {
		return fmt.Errorf("Could not set metadata: %s", self.Error())
	}
	return nil
}
Exemplo n.º 2
0
// Associates a property with an image.
func (mw *MagickWand) SetImageProperty(property, value string) error {
	csproperty := C.CString(property)
	defer C.free(unsafe.Pointer(csproperty))
	csvalue := C.CString(value)
	defer C.free(unsafe.Pointer(csvalue))
	C.MagickSetImageProperty(mw.mw, csproperty, csvalue)
	return mw.GetLastError()
}
Exemplo n.º 3
0
// Associates a metadata key with its value.
func (self *Canvas) SetMetadata(key string, value string) error {
	ckey := C.CString(key)
	cval := C.CString(value)

	success := C.MagickSetImageProperty(self.wand, ckey, cval)

	C.free(unsafe.Pointer(ckey))
	C.free(unsafe.Pointer(cval))

	if success == C.MagickFalse {
		return fmt.Errorf("Could not set metadata: %s", self.Error())
	}

	return nil
}
Exemplo n.º 4
0
// Associates a metadata key with its value.
func (cv Canvas) SetMetadata(key string, value string) {
	C.MagickSetImageProperty(cv.wand, C.CString(key), C.CString(value))
}