예제 #1
0
파일: canvas.go 프로젝트: mishudark/gosexy
// 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
}
예제 #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
}
예제 #3
0
파일: canvas.go 프로젝트: jmrobles/canvas
// 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
}
예제 #4
0
파일: canvas.go 프로젝트: phacops/canvas
// 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
}