// Writes canvas to a file, returns true on success. func (cv Canvas) Write(filename string) bool { cv.Update() status := C.MagickWriteImage(cv.wand, C.CString(filename)) if status == C.MagickFalse { return false } return true }
/* Writes an image to the specified filename. */ func (w *MagickWand) WriteImage(fileName string) error { if C.MagickWriteImage(w.wand, C.CString(fileName)) == C.MagickFalse { eStr, eCode := w.Exception() return fmt.Errorf("WriteImage() failed : [%d] %s", eStr, eCode) } return nil }
// Writes canvas to a file, returns true on success. func (self Canvas) Write(filename string) error { err := self.Update() if err != nil { return err } success := C.MagickWriteImage(self.wand, C.CString(filename)) if success == C.MagickFalse { return fmt.Errorf("Could not write: %s", self.Error()) } return nil }
// Writes canvas to a file, returns true on success. func (self *Canvas) Write(filename string) error { err := self.Update() if err != nil { return err } cfilename := C.CString(filename) success := C.MagickWriteImage(self.wand, cfilename) C.free(unsafe.Pointer(cfilename)) if success == C.MagickFalse { return fmt.Errorf("Could not write: %s", self.Error()) } return nil }