From e8f56490b69cb12652819c7015e16bb03c1dab98 Mon Sep 17 00:00:00 2001 From: anthony Date: Sun, 12 Feb 2012 12:39:02 +0000 Subject: [PATCH] Basic changes in prep for "magick" command --- MagickCore/option.c | 12 +++++------- MagickCore/option.h | 2 +- MagickWand/magick-image.c | 4 ++-- MagickWand/magick-wand.c | 18 +++++++++++++----- MagickWand/operation.c | 29 +++++++++++------------------ config/english.xml | 2 +- config/francais.xml | 2 +- 7 files changed, 34 insertions(+), 35 deletions(-) diff --git a/MagickCore/option.c b/MagickCore/option.c index a183bea04..b4054483a 100644 --- a/MagickCore/option.c +++ b/MagickCore/option.c @@ -339,6 +339,7 @@ static const OptionInfo { "-evaluate", 2L, SimpleOperatorOptionFlag, MagickFalse }, { "+evaluate-sequence", 1L, DeprecateOptionFlag | FireOptionFlag, MagickTrue }, { "-evaluate-sequence", 1L, ListOperatorOptionFlag | FireOptionFlag, MagickFalse }, + { "-exit", 1L, SpecialOptionFlag, MagickFalse }, { "+extent", 1L, DeprecateOptionFlag, MagickTrue }, { "-extent", 1L, SimpleOperatorOptionFlag, MagickFalse }, { "+extract", 0L, ImageInfoOptionFlag, MagickFalse }, @@ -389,8 +390,6 @@ static const OptionInfo { "-green-primary", 1L, ImageInfoOptionFlag, MagickFalse }, { "+hald-clut", 0L, DeprecateOptionFlag | FireOptionFlag, MagickTrue }, { "-hald-clut", 0L, ListOperatorOptionFlag | FireOptionFlag, MagickFalse }, - { "+help", 0L, SpecialOptionFlag, MagickFalse }, - { "-help", 0L, SpecialOptionFlag, MagickFalse }, { "+highlight-color", 1L, SimpleOperatorOptionFlag, MagickFalse }, { "-highlight-color", 1L, SimpleOperatorOptionFlag, MagickFalse }, { "+iconGeometry", 0L, NonConvertOptionFlag, MagickFalse }, @@ -485,7 +484,6 @@ static const OptionInfo { "-negate", 0L, SimpleOperatorOptionFlag, MagickFalse }, { "+noise", 1L, SimpleOperatorOptionFlag, MagickFalse }, { "-noise", 1L, SimpleOperatorOptionFlag, MagickFalse }, - { "+noop", 0L, SpecialOptionFlag, MagickFalse }, { "-noop", 0L, SpecialOptionFlag, MagickFalse }, { "+normalize", 0L, DeprecateOptionFlag, MagickTrue }, { "-normalize", 0L, SimpleOperatorOptionFlag, MagickFalse }, @@ -501,8 +499,8 @@ static const OptionInfo { "-page", 1L, ImageInfoOptionFlag, MagickFalse }, { "+paint", 0L, DeprecateOptionFlag, MagickTrue }, { "-paint", 1L, SimpleOperatorOptionFlag, MagickFalse }, - { "+path", 0L, SpecialOptionFlag, MagickFalse }, - { "-path", 1L, SpecialOptionFlag, MagickFalse }, + { "+path", 0L, NonConvertOptionFlag, MagickFalse }, + { "-path", 1L, NonConvertOptionFlag, MagickFalse }, { "+pause", 0L, NonConvertOptionFlag, MagickFalse }, { "-pause", 1L, NonConvertOptionFlag, MagickFalse }, { "+passphrase", 0L, DeprecateOptionFlag, MagickTrue }, @@ -703,7 +701,7 @@ static const OptionInfo { "+verbose", 0L, ImageInfoOptionFlag, MagickFalse }, { "-verbose", 0L, ImageInfoOptionFlag, MagickFalse }, { "+version", 0L, DeprecateOptionFlag, MagickTrue }, - { "-version", 1L, SpecialOptionFlag, MagickFalse }, + { "-version", 0L, SpecialOptionFlag, MagickFalse }, { "+view", 0L, ImageInfoOptionFlag, MagickFalse }, { "-view", 1L, ImageInfoOptionFlag, MagickFalse }, { "+vignette", 1L, DeprecateOptionFlag, MagickTrue }, @@ -1913,7 +1911,7 @@ MagickExport ssize_t GetCommandOptionFlags(const CommandOption option, option_info=GetOptionInfo(option); if (option_info == (const OptionInfo *) NULL) - return(-1); + return(UndefinedOptionFlag); option_types=0; sentinel=','; if (strchr(options,'|') != (char *) NULL) diff --git a/MagickCore/option.h b/MagickCore/option.h index 8ed06bf6a..8d8894744 100644 --- a/MagickCore/option.h +++ b/MagickCore/option.h @@ -145,7 +145,7 @@ typedef enum SpecialOptionFlag = 0x0040, /* Special handled Option */ GenesisOptionFlag = 0x0080, /* Genesis Command Wrapper Option */ - NonConvertOptionFlag = 0x1000, /* Option not used by Convert */ + NonConvertOptionFlag = 0x1000, /* Option not used by Convert/Magick */ FireOptionFlag = 0x4000, /* Convert operation seq firing point */ DeprecateOptionFlag = 0x8000 /* Deprecate option, give warning */ diff --git a/MagickWand/magick-image.c b/MagickWand/magick-image.c index fbb9533c4..ea77fb818 100644 --- a/MagickWand/magick-image.c +++ b/MagickWand/magick-image.c @@ -418,7 +418,7 @@ static inline MagickBooleanType InsertImageInWand(MagickWand *wand, } wand->set_first = MagickFalse; /* flag no longer valid */ - /* Current image was flaged as 'pending' iterative processing. */ + /* Current image was flagged as 'pending' iterative processing. */ if (wand->image_pending != MagickFalse) { /* current pending image is the last, append new images */ @@ -7734,7 +7734,7 @@ WandExport MagickBooleanType MagickRandomThresholdImage(MagickWand *wand, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % MagickReadImage() reads an image or image sequence. The images are inserted -% at the current image pointer position. +% jjust before the current image pointer position. % % Use MagickSetFirstIterator(), to insert new images before all the current % images in the wand, MagickSetLastIterator() to append add to the end, diff --git a/MagickWand/magick-wand.c b/MagickWand/magick-wand.c index 0bc0a85e7..a50013f6b 100644 --- a/MagickWand/magick-wand.c +++ b/MagickWand/magick-wand.c @@ -842,7 +842,7 @@ WandExport void MagickResetIterator(MagickWand *wand) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); wand->images=GetFirstImageInList(wand->images); wand->set_first=MagickFalse; /* we did not jump to the first image */ - wand->image_pending=MagickTrue; /* this image is the 'next' image */ + wand->image_pending=MagickTrue; /* pointed image is the 'next' image */ } /* @@ -858,6 +858,10 @@ WandExport void MagickResetIterator(MagickWand *wand) % % MagickSetFirstIterator() sets the wand iterator to the first image. % +% Flags are set to point not only to the 'next' image to be processed, +% but also define where InsertImageInWand() (such as from MagickReadImage()) +% should instert new images. +% % The format of the MagickSetFirstIterator method is: % % void MagickSetFirstIterator(MagickWand *wand) @@ -874,8 +878,8 @@ WandExport void MagickSetFirstIterator(MagickWand *wand) if (wand->debug != MagickFalse) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); wand->images=GetFirstImageInList(wand->images); - wand->set_first=MagickTrue; /* we jumped to the first image */ - wand->image_pending=MagickFalse; /* but this image is not 'next' */ + wand->set_first=MagickTrue; /* we did jumped to the first image */ + wand->image_pending=MagickFalse; /* but we are not iterating */ } /* @@ -925,7 +929,7 @@ WandExport MagickBooleanType MagickSetIteratorIndex(MagickWand *wand, } wand->images=image; wand->set_first=MagickFalse; /* we are not at very start of list */ - wand->image_pending=MagickFalse; /* but it is not iteration pending */ + wand->image_pending=MagickFalse; /* but we are not directly iterating */ return(MagickTrue); } /* @@ -941,6 +945,10 @@ WandExport MagickBooleanType MagickSetIteratorIndex(MagickWand *wand, % % MagickSetLastIterator() sets the wand iterator to the last image. % +% Flags are set to point not only to the 'previous' image to be processed, +% but also define where InsertImageInWand() (such as from MagickReadImage()) +% should instert new images. +% % The format of the MagickSetLastIterator method is: % % void MagickSetLastIterator(MagickWand *wand) @@ -958,7 +966,7 @@ WandExport void MagickSetLastIterator(MagickWand *wand) (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name); wand->images=GetLastImageInList(wand->images); wand->set_first=MagickFalse; /* we are not at very start of list */ - wand->image_pending=MagickFalse; /* and is not iteration pending */ + wand->image_pending=MagickFalse; /* but we are not iterating */ } /* diff --git a/MagickWand/operation.c b/MagickWand/operation.c index 0b6a106bc..58a53c54c 100644 --- a/MagickWand/operation.c +++ b/MagickWand/operation.c @@ -54,7 +54,6 @@ #include "MagickCore/monitor-private.h" #include "MagickCore/thread-private.h" #include "MagickCore/string-private.h" -#if 0 /* Define declarations. @@ -904,6 +903,9 @@ WandExport void WandSettingOptionInfo(MagickWand *wand,const char *option, ssize_t list; + /* FUTURE: This is not really a Setting Option, but a Special + * The bulk of this should be turned into a MagickCore function + */ list=ParseCommandOption(MagickListOptions,MagickFalse, ArgOption("list")); switch (list) @@ -1473,7 +1475,7 @@ WandExport void WandSettingOptionInfo(MagickWand *wand,const char *option, % % count=ParseCommandOption(MagickCommandOptions,MagickFalse,argv[i]); % flags=GetCommandOptionFlags(MagickCommandOptions,MagickFalse,argv[i]); -% if ( flags & SimpleOperatorOptionFlag != 0 ) +% if ( (flags & SimpleOperatorOptionFlag) != 0 ) % WandSimpleOperatorImages(wand, % ((*argv[i])=='+')?MagickTrue:MagickFalse,argv[i]+1, % count>=1 ? argv[i+1] : (char *)NULL, @@ -3351,9 +3353,8 @@ WandExport void WandSimpleOperatorImages(MagickWand *wand, % % Example usage... % -% WandListOperatorImages(wand,"read", MagickFalse,"rose:",NULL); -% WandListOperatorImages(wand,"duplicate",MagickFalse,"3",NULL); -% WandListOperatorImages(wand,"append",MagickTrue,NULL,NULL); +% WandListOperatorImages(wand,MagickFalse,"duplicate", "3", NULL); +% WandListOperatorImages(wand,MagickTrue, "append", NULL, NULL); % if ( wand->exception->severity != UndefinedException ) { % CatchException(exception); % exit(1); @@ -3366,7 +3367,7 @@ WandExport void WandSimpleOperatorImages(MagickWand *wand, % % count=ParseCommandOption(MagickCommandOptions,MagickFalse,argv[i]); % flags=GetCommandOptionFlags(MagickCommandOptions,MagickFalse,argv[i]); -% if ( flags & ListOperatorOptionFlag != 0 ) +% if ( (flags & ListOperatorOptionFlag) != 0 ) % WandListOperatorImages(wand, % ((*argv[i])=='+')?MagickTrue:MagickFalse,argv[i]+1, % count>=1 ? argv[i+1] : (char *)NULL, @@ -3431,6 +3432,7 @@ WandExport void WandListOperatorImages(MagickWand *wand, new_images=RemoveFirstImageFromList(&images); clut_image=RemoveLastImageFromList(&images); + /* FUTURE - produce Exception, rather than silent fail */ if (clut_image == (Image *) NULL) break; (void) ClutImage(new_images,clut_image,images->interpolate,exception); @@ -3471,8 +3473,10 @@ WandExport void WandListOperatorImages(MagickWand *wand, new_images=RemoveFirstImageFromList(&images); source_image=RemoveFirstImageFromList(&images); + /* FUTURE - produce Exception, rather than silent fail */ if (source_image == (Image *) NULL) break; + /* FUTURE - this should not be here! - should be part of -geometry */ (void) TransformImage(&source_image,(char *) NULL, source_image->geometry,exception); @@ -3617,6 +3621,7 @@ WandExport void WandListOperatorImages(MagickWand *wand, magnitude_image=RemoveFirstImageFromList(&images); phase_image=RemoveFirstImageFromList(&images); + /* FUTURE - produce Exception, rather than silent fail */ if (phase_image == (Image *) NULL) break; new_images=InverseFourierTransformImage(magnitude_image,phase_image, @@ -3936,17 +3941,6 @@ WandExport void WandListOperatorImages(MagickWand *wand, } case 'r': { - if (LocaleCompare("read",option) == 0) - { - CopyMagickString(image_info->filename,arg1,MaxTextExtent); - if (image_info->ping != MagickFalse) - new_images=PingImages(image_info,exception); - else - new_images=ReadImages(image_info,exception); - AppendImageToList(&images, new_images); - new_images=(Image *) NULL; - break; - } if (LocaleCompare("remap",option) == 0) { (void) RemapImages(quantize_info,images,(Image *) NULL,exception); @@ -4068,4 +4062,3 @@ WandExport void WandListOperatorImages(MagickWand *wand, #undef exception #undef normal_op } -#endif diff --git a/config/english.xml b/config/english.xml index d0886f4ff..05159841b 100644 --- a/config/english.xml +++ b/config/english.xml @@ -710,7 +710,7 @@ unrecognized color - unrecognized image colorspace + unrecognized colorspace unrecognized compose operator diff --git a/config/francais.xml b/config/francais.xml index 0896d1211..768983566 100644 --- a/config/francais.xml +++ b/config/francais.xml @@ -701,7 +701,7 @@ couleur non reconnue - espace colorimétrique de l'image non reconnu + espace colorimétrique non reconnu opérateur de composition non reconnu -- 2.40.0