From ade6afb1c01572b4baeadcf7be96602b8d0fbca6 Mon Sep 17 00:00:00 2001 From: anthony Date: Thu, 15 Mar 2012 13:24:43 +0000 Subject: [PATCH] --- MagickWand/magick-image.c | 10 +++++----- MagickWand/magick-wand.c | 6 +++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/MagickWand/magick-image.c b/MagickWand/magick-image.c index 526214d67..278edb95b 100644 --- a/MagickWand/magick-image.c +++ b/MagickWand/magick-image.c @@ -402,7 +402,7 @@ WandExport MagickBooleanType MagickAdaptiveThresholdImage(MagickWand *wand, static inline MagickBooleanType InsertImageInWand(MagickWand *wand, Image *images) { - /* if no images in wand, just add them, set wand->images as appropriate */ + /* if no images in wand, just add them, set current as appropriate */ if (wand->images == (Image *) NULL) { if (wand->insert_before != MagickFalse) @@ -420,9 +420,9 @@ static inline MagickBooleanType InsertImageInWand(MagickWand *wand, wand->images=GetFirstImageInList(images); return(MagickTrue); } - /* Note you should never have 'insert_before' true when wand->images image + /* Note you should never have 'insert_before' true when current image is not the first image in the wand! That is no insert before - wand->images image, only after current image */ + current image, only after current image */ /* if at last image append new images */ if (wand->images->next == (Image *) NULL) @@ -431,7 +431,7 @@ static inline MagickBooleanType InsertImageInWand(MagickWand *wand, wand->images=GetLastImageInList(images); return(MagickTrue); } - /* otherwise insert new images, just after the wand->images image */ + /* otherwise insert new images, just after the current image */ InsertImageInList(&wand->images,images); return(MagickTrue); } @@ -6834,7 +6834,7 @@ WandExport MagickBooleanType MagickNewImage(MagickWand *wand,const size_t width, % % MagickNextImage() sets the next image in the wand as the current image. % It returns MagickTrue if their is another image to be processed. -% +% % Returns MagickFalse when current image is already the last image % in the wand (no more next images), at whcih point you can use % MagickPreviousImage() to again iterate over the images in the reverse diff --git a/MagickWand/magick-wand.c b/MagickWand/magick-wand.c index 2fd8ce15f..cc44b0c5d 100644 --- a/MagickWand/magick-wand.c +++ b/MagickWand/magick-wand.c @@ -92,6 +92,8 @@ WandExport void ClearMagickWand(MagickWand *wand) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); wand->images=DestroyImageList(wand->images); wand->image_info=AcquireImageInfo(); + wand->insert_before=MagickFalse; + wand->image_pending=MagickFalse; ClearMagickException(wand->exception); wand->debug=IsEventLogging(); } @@ -139,6 +141,8 @@ WandExport MagickWand *CloneMagickWand(const MagickWand *wand) InheritException(clone_wand->exception,wand->exception); clone_wand->image_info=CloneImageInfo(wand->image_info); clone_wand->images=CloneImageList(wand->images,clone_wand->exception); + clone_wand->insert_before=MagickFalse; + clone_wand->image_pending=MagickFalse; clone_wand->debug=IsEventLogging(); if (clone_wand->debug != MagickFalse) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",clone_wand->name); @@ -826,7 +830,7 @@ WandExport void MagickResetIterator(MagickWand *wand) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); wand->images=GetFirstImageInList(wand->images); wand->insert_before=MagickFalse; /* Insert/add after current (first) image */ - wand->image_pending=MagickTrue; /* NextImage will remain this image */ + wand->image_pending=MagickTrue; /* NextImage will set first image */ } /* -- 2.40.0