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)
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)
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);
}
%
% 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
(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();
}
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);
(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 */
}
\f
/*