예제 #1
0
파일: canvas.go 프로젝트: phacops/canvas
func (self *Canvas) Strip() error {
	var status C.MagickBooleanType

	status = C.MagickStripImage(self.wand)

	if status == C.MagickFalse {
		return fmt.Errorf("Could not strip: %s", self.Error())
	}

	return nil
}
예제 #2
0
파일: image.go 프로젝트: zesus19/nephele
/*
Strip() removes all profiles and text attributes from this image.
*/
func (this *Image) Strip() error {
	if this.magickWand == nil {
		return errors.New("error strip image:magickwand is nil")
	}

	status := C.MagickStripImage(this.magickWand)
	if status == 0 {
		var etype int
		descr := C.MagickGetException(this.magickWand, (*C.ExceptionType)(unsafe.Pointer(&etype)))
		defer C.MagickRelinquishMemory(unsafe.Pointer(descr))
		return errors.New(fmt.Sprintf("error strip image: %s (ExceptionType = %d)", C.GoString(descr), etype))
	}

	return nil
}
예제 #3
0
/*
Strip() removes all profiles and text attributes from this image.
*/
func (this *Image) Strip() error {
	var err error = nil
	tran := this.Cat.NewTransaction("GraphicsMagickCmd", "Strip")
	defer func() {
		tran.SetStatus(err)
		tran.Complete()
	}()
	if this.magickWand == nil {
		err = errors.New("error strip image:magickwand is nil")
		return err
	}

	status := C.MagickStripImage(this.magickWand)
	if status == 0 {
		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 strip image: %s (ExceptionType = %d)", C.GoString(descr), etype))
		return err
	}

	return nil
}
예제 #4
0
func (img *Image) Strip() {
	C.MagickStripImage(img.wand)
}
예제 #5
0
파일: mage.go 프로젝트: dqminh/mage
// Private: strip all comments and profiles from an image
//
// Examples:
//  m.strip()
func (m *Mage) strip() bool {
	return mBoolean(C.MagickStripImage(m.wand))
}