so as to correctly implement %p, %n and %[fx:t], %[fx:n] resp.
* Replaced Minus and Divide Composition methods with Dst and Src
equivalents. Now users can decide how these non-commutative mathematical
operators are applied the to the images being composited.
+ * Fix the percent escape values for %p, %n and %[fx:t], %[fx:n] to
+ respectivally mean a the current images index and the total number of
+ images within the current image sequence.
2011-03-17 6.6.8-5 Anthony Thyssen <A.Thyssen@griffith...>
* Backed out the patch for Variable Blur Composition that was added
*profile;
next->taint=MagickFalse;
+ next->page_index = next->page_total= 0;
GetPathComponent(magick_filename,MagickPath,magick_path);
if (*magick_path == '\0')
(void) CopyMagickString(next->magick,magick,MaxTextExtent);
storage_class;
ColorspaceType
- colorspace;
+ colorspace; /* colorspace of image data */
CompressionType
- compression;
+ compression; /* compression of image when read/write */
size_t
- quality;
+ quality; /* compression quality setting, meaning varies */
OrientationType
- orientation;
+ orientation; /* photo orientation of image */
MagickBooleanType
- taint,
- matte;
+ taint, /* has image been modified since reading */
+ matte; /* is transparency channel defined and active */
size_t
- columns,
+ columns, /* physical size of image */
rows,
- depth,
- colors;
+ depth, /* depth of image on read/write */
+ colors; /* size of color table on read */
PixelPacket
*colormap,
- background_color,
- border_color,
- matte_color;
+ background_color, /* current background color attribute */
+ border_color, /* current bordercolor attribute */
+ matte_color; /* current mattecolor attribute */
double
gamma;
*profiles;
ResolutionType
- units;
+ units; /* resolution/density ppi or ppc */
char
*montage,
offset;
double
- x_resolution,
+ x_resolution, /* image resolution/density */
y_resolution;
RectangleInfo
- page,
+ page, /* virtual canvas size and offset of image */
extract_info,
- tile_info; /* deprecated */
+ tile_info; /* deprecated */
double
bias,
- blur, /* deprecated */
- fuzz;
+ blur, /* deprecated */
+ fuzz; /* current color fuzz attribute */
FilterTypes
- filter;
+ filter; /* resize/distort filter to apply */
InterlaceType
interlace;
EndianType
- endian;
+ endian; /* raw data integer ordering on read/write */
GravityType
- gravity;
+ gravity; /* Gravity attribute for positioning in image */
CompositeOperator
- compose;
+ compose; /* alpha composition method for layered images */
DisposeType
- dispose;
+ dispose; /* GIF animation disposal method */
struct _Image
*clip_mask;
size_t
- scene,
- delay;
+ scene, /* index of image in multi-image file */
+ delay; /* Animation delay time */
ssize_t
- ticks_per_second;
+ ticks_per_second; /* units for delay time, default 100 for GIF */
size_t
iterations,
void
*client_data,
*cache,
- *attributes; /* deprecated */
+ *attributes; /* deprecated */
Ascii85Info
*ascii85;
*blob;
char
- filename[MaxTextExtent],
+ filename[MaxTextExtent], /* images input filename */
magick_filename[MaxTextExtent],
magick[MaxTextExtent];
magick_rows;
ExceptionInfo
- exception;
+ exception; /* Error handling report */
MagickBooleanType
- debug;
+ debug; /* debug output attribute */
volatile ssize_t
reference_count;
signature;
struct _Image
- *previous,
+ *previous, /* Image sequence list links */
*list,
*next;
InterpolatePixelMethod
- interpolate;
+ interpolate; /* Interpolation of color for between pixel lookups */
MagickBooleanType
black_point_compensation;
PixelPacket
- transparent_color;
+ transparent_color; /* color for 'transparent' color index in GIF */
struct _Image
*mask;
tile_offset;
void
- *properties,
- *artifacts;
+ *properties, /* per image properities */
+ *artifacts; /* per image sequence image artifacts */
ImageType
type;
MagickBooleanType
- dither;
+ dither; /* dithering method during color reduction */
MagickSizeType
extent;
MagickBooleanType
ping;
+
+ size_t
+ page_index, /* %p current index in working image sequence */
+ page_total; /* %n total pages in working image sequence */
};
+
struct _ImageInfo
{
CompressionType
% %
% %
% %
++ P a g e I n d e x I m a g e L i s t %
+% %
+% %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% PageIndexImageList() synchronizes the page_index and page_total values
+% in the image list.
+%
+% These values are used by InterpretImageProperties() to set %p and %n
+% percent escapes. The value is preserved, even if the image is later removed
+% from the list using RemoveFirstImageFromList() for individual image
+% processing.
+%
+% The format of the PageIndexImageList method is:
+%
+% void PageIndexImageList(Image *images)
+%
+% A description of each parameter follows:
+%
+% o images: the image list.
+%
+*/
+MagickExport void PageIndexImageList(Image *images)
+{
+ register ssize_t
+ p,n;
+
+ if (images == (Image *) NULL)
+ return;
+ assert(images->signature == MagickSignature);
+ if (images->debug != MagickFalse)
+ (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",images->filename);
+
+ /* find start for image counting */
+ while (images->previous != (Image *) NULL)
+ images=images->previous;
+
+ /* count up images - find end */
+ n=1;
+ while (images->next != (Image *) NULL)
+ images=images->next, n++;
+
+ /* set page_index and page_total attributes */
+ p=n-1;
+ for (; images != (Image *) NULL; images=images->previous)
+ images->page_index=p--, images->page_total=n;
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% %
+% %
% P r e p e n d I m a g e T o L i s t %
% %
% %
DeleteImageFromList(Image **),
DeleteImages(Image **,const char *,ExceptionInfo *),
InsertImageInList(Image **,Image *),
+ PageIndexImageList(Image *),
PrependImageToList(Image **,Image *),
ReplaceImageInList(Image **,Image *),
ReverseImageList(Image **),
continue;
AppendImageStack(images);
FinalizeImageSettings(image_info,image,MagickFalse);
+ PageIndexImageList(images);
for ( ; image != (Image *) NULL; image=GetNextImageInList(image))
{
if (image->scene == 0)
number_colors++;
if ((channels & OpacityChannel) != 0)
number_colors++;
+
/*
Read string, to determine number of arguments needed,
*/
*fx_image;
(void) SyncImagesSettings(mogrify_info,*images);
+ PageIndexImageList(*images);
fx_image=FxImageChannel(*images,channel,argv[i+1],exception);
if (fx_image == (Image *) NULL)
{
return(MagickTrue);
(void) SetImageInfoProgressMonitor(image_info,(MagickProgressMonitor) NULL,
(void *) NULL);
- mogrify_images=NewImageList();
- number_images=GetImageListLength(*images);
status=0;
if (post == MagickFalse)
status&=MogrifyImageList(image_info,argc,argv,images,exception);
+ PageIndexImageList(*images);
+ number_images=(*images)->page_total;
+ mogrify_images=NewImageList();
for (i=0; i < (ssize_t) number_images; i++)
{
image=RemoveFirstImageFromList(images);