Exemplo n.º 1
0
// 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
}
Exemplo n.º 2
0
/* 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
}
Exemplo n.º 3
0
// 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
}
Exemplo n.º 4
0
// 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
}