Esempio n. 1
0
File: magick.go Progetto: 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)
}
Esempio n. 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
}