示例#1
0
文件: canvas.go 项目: jmrobles/canvas
// 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
}
示例#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()
}
示例#3
0
文件: canvas.go 项目: phacops/canvas
// 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
}
示例#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))
}