// PixbufGetFileInfo is a wrapper around gdk_pixbuf_get_file_info(). // TODO: need to wrap the returned format to GdkPixbufFormat. func PixbufGetFileInfo(filename string) (format interface{}, width, height int) { cstr := C.CString(filename) defer C.free(unsafe.Pointer(cstr)) var cw, ch C.gint format = C.gdk_pixbuf_get_file_info((*C.gchar)(cstr), &cw, &ch) // TODO: need to wrap the returned format to GdkPixbufFormat. return format, int(cw), int(ch) }
func GetFileInfo(filename string, width, height *int) *Format { ptr := C.CString(filename) defer cfree(ptr) var w, h C.gint format := &Format{C.gdk_pixbuf_get_file_info(gstring(ptr), &w, &h)} *width = int(w) *height = int(h) return format }
func GetFileInfo(path string, imgW *int, imgH *int) *GdkPixbufFormat { ptr := C.CString(path) defer C.free_string(ptr) var w, h C.gint format := &GdkPixbufFormat{C.gdk_pixbuf_get_file_info(C.to_gcharptr(ptr), &w, &h)} *imgW = int(w) *imgH = int(h) return format }