예제 #1
0
func (im *Image) property(key string) *string {
	k := C.CString(key)
	prop := C.GetImageAttribute(im.image, k)
	C.free(unsafe.Pointer(k))
	if prop != nil && prop.value != nil {
		s := C.GoString(prop.value)
		return &s
	}
	return nil
}
예제 #2
0
func (im *Image) properties() []string {
	prop := C.GetImageAttribute(im.image, nil)
	var props []string
	for prop != nil {
		if prop.key != nil {
			s := C.GoString(prop.key)
			props = append(props, s)
		}
		prop = (*C.ImageAttribute)(prop.next)
	}
	return props
}