예제 #1
0
파일: magick.go 프로젝트: mat/magick
// GetProperty() retreives the given attribute or freeform property
// string on the underlying Image
func (im *MagickImage) GetProperty(prop string) (value string) {
	c_prop := C.CString(prop)
	defer C.free(unsafe.Pointer(c_prop))
	c_value := C.GetImageProperty(im.Image, c_prop)
	defer C.free(unsafe.Pointer(c_value))
	return C.GoString(c_value)
}
예제 #2
0
func (im *Image) property(key string) *string {
	k := C.CString(key)
	prop := C.GetImageProperty(im.image, k)
	C.free(unsafe.Pointer(k))
	if prop != nil {
		s := C.GoString(prop)
		return &s
	}
	return nil
}