/* GetFormat() return format of this image */ func (this *Image) GetFormat() (string, error) { var err error = nil tran := this.Cat.NewTransaction("GraphicsMagickCmd", "GetFormat") defer func() { tran.SetStatus(err) tran.Complete() }() if this.magickWand == nil { err = errors.New("error get image format:magickwand is nil") return "", err } format := C.MagickGetImageFormat(this.magickWand) if format == nil { var etype int descr := C.MagickGetException(this.magickWand, (*C.ExceptionType)(unsafe.Pointer(&etype))) defer C.MagickRelinquishMemory(unsafe.Pointer(descr)) err = errors.New(fmt.Sprintf("error get image format: %s (ExceptionType = %d)", C.GoString(descr), etype)) return "", err } return C.GoString(format), nil }
func (self *Canvas) Format() string { ptr := C.MagickGetImageFormat(self.wand) defer C.free(unsafe.Pointer(ptr)) return C.GoString(ptr) }
// Returns image format func (self Canvas) Format() string { return C.GoString(C.MagickGetImageFormat(self.wand)) }
/* Gets the format of a particular image in a sequence. */ func (w *MagickWand) ImageFormat() string { return C.GoString(C.MagickGetImageFormat(w.wand)) }
func (cv Canvas) Format() string { format := C.MagickGetImageFormat(cv.wand) return strings.Trim(C.GoString(format), " ") }