Example #1
0
// Changes the compression quality of the canvas. Ranges from 1 (lowest) to 100 (highest).
func (cv Canvas) SetQuality(quality uint) bool {
	status := C.MagickSetImageCompressionQuality(cv.wand, C.size_t(quality))
	if status == C.MagickFalse {
		return false
	}
	return true
}
Example #2
0
/* Sets the image compression quality. */
func (w *MagickWand) SetImageCompressionQuality(quality uint) error {
	if C.MagickSetImageCompressionQuality(w.wand, C.size_t(quality)) == C.MagickFalse {
		eStr, eCode := w.Exception()
		return fmt.Errorf("SetImageCompressionQuality() failed : [%d] %s", eStr, eCode)
	}

	return nil
}
Example #3
0
// Changes the compression quality of the canvas. Ranges from 1 (lowest) to 100 (highest).
func (self *Canvas) SetQuality(quality uint) error {
	success := C.MagickSetImageCompressionQuality(self.wand, C.size_t(quality))

	if success == C.MagickFalse {
		return fmt.Errorf("Could not set compression quality: %s", self.Error())
	}

	return nil
}