From: anthony Date: Fri, 11 May 2012 01:56:24 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~5619 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=451f909cf486b03805c10c8075a4bdb8330a1ddd;p=imagemagick --- diff --git a/MagickCore/resample.c b/MagickCore/resample.c index a7e8eba99..5d7af2f81 100644 --- a/MagickCore/resample.c +++ b/MagickCore/resample.c @@ -1323,7 +1323,7 @@ MagickExport void SetResampleFilter(ResampleFilter *resample_filter, #pragma omp single #endif { - if (IsStringTrue(GetImageArtifact(resample_filter->image, + if (IfStringTrue(GetImageArtifact(resample_filter->image, "resample:verbose")) ) { register int diff --git a/MagickCore/utility.c b/MagickCore/utility.c index 3de0414b7..f17056da1 100644 --- a/MagickCore/utility.c +++ b/MagickCore/utility.c @@ -699,6 +699,16 @@ MagickPrivate void ExpandFilename(char *path) % Expansion is ignored for coders "label:" "caption:" "pango:" and "vid:". % Which provide their own '@' meta-character handling. % +% You can see the results of the expansion using "Configure" log +% events. +% +% +% The returned list should be freed using DestroyStringList(). +% +% However the strings in the original pointed to argv are not +% freed (TO BE CHECKED). So a copy of the original pointer (and count) +% should be kept separate if they need to be freed later. +% % % The format of the ExpandFilenames function is: % diff --git a/MagickWand/magick-cli.c b/MagickWand/magick-cli.c index 66c9e4c42..1430422cc 100644 --- a/MagickWand/magick-cli.c +++ b/MagickWand/magick-cli.c @@ -686,7 +686,7 @@ static MagickBooleanType ConcatenateImages(int argc,char **argv, register ssize_t i; - if (IfMagickFalse(ExpandFilenames(&argc,&argv))) + if (IfMagickFalse( ExpandFilenames(&argc,&argv) )) ThrowFileException(exception,ResourceLimitError,"MemoryAllocationFailed", GetExceptionMessage(errno)); @@ -725,13 +725,6 @@ WandExport MagickBooleanType MagickImageCommand(ImageInfo *image_info, /* For specific OS command line requirements */ ReadCommandlLine(argc,&argv); -#if 0 - status=ExpandFilenames(&argc,&argv); - if ( IfMagickFalse(status) ) - ThrowConvertException(ResourceLimitError,"MemoryAllocationFailed", - GetExceptionMessage(errno)); -#endif - /* Initialize special "CLI Wand" to hold images and settings (empty) */ cli_wand=AcquireMagickCLI(image_info,exception); cli_wand->line=1; diff --git a/MagickWand/operation.c b/MagickWand/operation.c index cff6f2b8f..e4cf41f8b 100644 --- a/MagickWand/operation.c +++ b/MagickWand/operation.c @@ -4279,7 +4279,6 @@ WandExport void CLINoImageOperator(MagickCLI *cli_wand, ( LocaleCompare("--",option) == 0 ) ) { #if 0 /* Directly read 'arg1' without filename expansion handling (see below). - This does NOT turn off the 'coder:' prefix, or '[...]' read modifiers. */ # if !USE_WAND_METHODS Image *new_images; @@ -4318,7 +4317,11 @@ WandExport void CLINoImageOperator(MagickCLI *cli_wand, argc = 1; argv = (char **) &arg1; - if (IfMagickFalse(ExpandFilenames(&argc,&argv))) + /* Expand 'glob' expressions in the given filename. + Expansion handles any 'coder:' prefix, or read modifiers attached + to the filename, including them in the resulting expanded list. + */ + if (IfMagickFalse( ExpandFilenames(&argc,&argv) )) CLIWandExceptArgReturn(ResourceLimitError,"MemoryAllocationFailed", option,GetExceptionMessage(errno)); @@ -4335,8 +4338,7 @@ fprintf(stderr, "DEBUG: Reading image: \"%s\"\n", argv[i]); new_images=ReadImages(_image_info,argv[i],_exception); AppendImageToList(&_images, new_images); } - /* FUTURE: how do I free the expanded filename array memory ??? */ - //argv=DestroyStringList(argv); /* Is this correct? */ + argv=DestroyStringList(argv); /* Destroy the Expanded Filename list */ #endif return; }