From: cristy Date: Sat, 25 Jul 2015 18:05:50 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~756 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=327030cbe756eb9aa6c63d0bdebfc7cf3b5f06a7;p=imagemagick --- diff --git a/MagickCore/option.c b/MagickCore/option.c index 2b78b9e6f..20e2cded6 100644 --- a/MagickCore/option.c +++ b/MagickCore/option.c @@ -515,8 +515,8 @@ static const OptionInfo { "-magnify", 0L, SimpleOperatorFlag, MagickFalse }, { "+map", 0L, ReplacedOptionFlag | ListOperatorFlag | FireOptionFlag, MagickTrue }, { "-map", 1L, ReplacedOptionFlag | SimpleOperatorFlag, MagickTrue }, - { "+mask", 0L, SimpleOperatorFlag | NeverInterpretArgsFlag, MagickFalse }, - { "-mask", 1L, SimpleOperatorFlag | NeverInterpretArgsFlag, MagickFalse }, + { "+mask", 0L, DeprecateOptionFlag | NeverInterpretArgsFlag, MagickFalse }, + { "-mask", 1L, DeprecateOptionFlag | NeverInterpretArgsFlag, MagickFalse }, { "-matte", 0L, ReplacedOptionFlag | SimpleOperatorFlag, MagickTrue }, { "+matte", 0L, ReplacedOptionFlag | SimpleOperatorFlag, MagickTrue }, { "+mattecolor", 0L, ImageInfoOptionFlag, MagickFalse }, @@ -601,6 +601,8 @@ static const OptionInfo { "+random-threshold", 1L, DeprecateOptionFlag, MagickTrue }, { "-random-threshold", 1L, SimpleOperatorFlag, MagickFalse }, { "-read", 1L, NoImageOperatorFlag | NeverInterpretArgsFlag, MagickFalse }, + { "+read-mask", 0L, SimpleOperatorFlag | NeverInterpretArgsFlag, MagickFalse }, + { "-read-mask", 1L, SimpleOperatorFlag | NeverInterpretArgsFlag, MagickFalse }, { "+recolor", 1L, DeprecateOptionFlag, MagickTrue }, { "-recolor", 1L, ReplacedOptionFlag | SimpleOperatorFlag, MagickTrue }, { "+red-primary", 0L, ImageInfoOptionFlag, MagickFalse }, @@ -788,6 +790,8 @@ static const OptionInfo { "-window-group", 1L, NonMagickOptionFlag, MagickFalse }, { "-write", 1L, NoImageOperatorFlag | NeverInterpretArgsFlag | FireOptionFlag, MagickFalse }, { "+write", 1L, NoImageOperatorFlag | NeverInterpretArgsFlag | FireOptionFlag, MagickFalse }, + { "+write-mask", 0L, SimpleOperatorFlag | NeverInterpretArgsFlag, MagickFalse }, + { "-write-mask", 1L, SimpleOperatorFlag | NeverInterpretArgsFlag, MagickFalse }, { (char *) NULL, 0L, UndefinedOptionFlag, MagickFalse } }, ComposeOptions[] = diff --git a/MagickWand/convert.c b/MagickWand/convert.c index 9ed4d9999..0384d68d8 100644 --- a/MagickWand/convert.c +++ b/MagickWand/convert.c @@ -405,7 +405,6 @@ static MagickBooleanType ConvertUsage(void) "-label string assign a label to an image", "-limit type value pixel cache resource limit", "-loop iterations add Netscape loop extension to your GIF animation", - "-mask filename associate a mask with the image", "-matte store matte channel if the image has one", "-mattecolor color frame color", "-moments report image moments", @@ -418,6 +417,7 @@ static MagickBooleanType ConvertUsage(void) "-preview type image preview type", "-quality value JPEG/MIFF/PNG compression level", "-quiet suppress all warning messages", + "-read-mask filename associate a read mask with the image", "-red-primary point chromaticity red primary point", "-regard-warnings pay attention to warning messages", "-remap filename transform image colors to match this set of colors", @@ -448,6 +448,7 @@ static MagickBooleanType ConvertUsage(void) " virtual pixel access method", "-weight type render text with this font weight", "-white-point point chromaticity white point", + "-write-mask filename associate a write mask with the image", (char *) NULL }, *stack_operators[]= diff --git a/MagickWand/identify.c b/MagickWand/identify.c index 68b8bc362..f3f98fdab 100644 --- a/MagickWand/identify.c +++ b/MagickWand/identify.c @@ -137,13 +137,13 @@ static MagickBooleanType IdentifyUsage(void) "-interlace type type of image interlacing scheme", "-interpolate method pixel color interpolation method", "-limit type value pixel cache resource limit", - "-mask filename associate a mask with the image", "-matte store matte channel if the image has one", "-moments report image moments", "-monitor monitor progress", "-ping efficiently determine image attributes", "-precision value maximum number of significant digits to print", "-quiet suppress all warning messages", + "-read-mask filename associate a read mask with the image", "-regard-warnings pay attention to warning messages", "-respect-parentheses settings remain in effect until parenthesis boundary", "-sampling-factor geometry", diff --git a/MagickWand/mogrify.c b/MagickWand/mogrify.c index 7a4498933..8fe15fb69 100644 --- a/MagickWand/mogrify.c +++ b/MagickWand/mogrify.c @@ -2529,6 +2529,31 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, (void) RandomThresholdImage(*image,argv[i+1],exception); break; } + if (LocaleCompare("read-mask",option+1) == 0) + { + Image + *mask; + + (void) SyncImageSettings(mogrify_info,*image,exception); + if (*option == '+') + { + /* + Remove a mask. + */ + (void) SetImageMask(*image,ReadPixelMask,(Image *) NULL, + exception); + break; + } + /* + Set the image mask. + */ + mask=GetImageCache(mogrify_info,argv[i+1],exception); + if (mask == (Image *) NULL) + break; + (void) SetImageMask(*image,ReadPixelMask,mask,exception); + mask=DestroyImage(mask); + break; + } if (LocaleCompare("region",option+1) == 0) { (void) SyncImageSettings(mogrify_info,*image,exception); @@ -3272,6 +3297,31 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc, (void) WhiteThresholdImage(*image,argv[i+1],exception); break; } + if (LocaleCompare("write-mask",option+1) == 0) + { + Image + *mask; + + (void) SyncImageSettings(mogrify_info,*image,exception); + if (*option == '+') + { + /* + Remove a mask. + */ + (void) SetImageMask(*image,WritePixelMask,(Image *) NULL, + exception); + break; + } + /* + Set the image mask. + */ + mask=GetImageCache(mogrify_info,argv[i+1],exception); + if (mask == (Image *) NULL) + break; + (void) SetImageMask(*image,WritePixelMask,mask,exception); + mask=DestroyImage(mask); + break; + } break; } default: @@ -3615,7 +3665,6 @@ static MagickBooleanType MogrifyUsage(void) "-label string assign a label to an image", "-limit type value pixel cache resource limit", "-loop iterations add Netscape loop extension to your GIF animation", - "-mask filename associate a mask with the image", "-matte store matte channel if the image has one", "-mattecolor color frame color", "-monitor monitor progress", @@ -3628,6 +3677,7 @@ static MagickBooleanType MogrifyUsage(void) "-preview type image preview type", "-quality value JPEG/MIFF/PNG compression level", "-quiet suppress all warning messages", + "-read-mask filename associate a read mask with the image", "-red-primary point chromaticity red primary point", "-regard-warnings pay attention to warning messages", "-remap filename transform image colors to match this set of colors", @@ -3657,6 +3707,7 @@ static MagickBooleanType MogrifyUsage(void) " virtual pixel access method", "-weight type render text with this font weight", "-white-point point chromaticity white point", + "-write-mask filename associate a write mask with the image", (char *) NULL }, *stack_operators[]= @@ -5658,6 +5709,15 @@ WandExport MagickBooleanType MogrifyImageCommand(ImageInfo *image_info, ThrowMogrifyInvalidArgumentException(option,argv[i]); break; } + if (LocaleCompare("read-mask",option+1) == 0) + { + if (*option == '+') + break; + i++; + if (i == (ssize_t) argc) + ThrowMogrifyException(OptionError,"MissingArgument",option); + break; + } if (LocaleCompare("red-primary",option+1) == 0) { if (*option == '+') @@ -6358,6 +6418,15 @@ WandExport MagickBooleanType MogrifyImageCommand(ImageInfo *image_info, ThrowMogrifyException(OptionError,"MissingArgument",option); break; } + if (LocaleCompare("write-mask",option+1) == 0) + { + if (*option == '+') + break; + i++; + if (i == (ssize_t) argc) + ThrowMogrifyException(OptionError,"MissingArgument",option); + break; + } ThrowMogrifyException(OptionError,"UnrecognizedOption",option) } case '?': diff --git a/MagickWand/operation.c b/MagickWand/operation.c index fc8dd30cc..8156af1e7 100644 --- a/MagickWand/operation.c +++ b/MagickWand/operation.c @@ -2740,22 +2740,9 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand, } if (LocaleCompare("mask",option+1) == 0) { - /* Note: arguments do not have percent escapes expanded */ - Image - *mask; - - if (IfPlusOp) - { /* Remove a mask. */ - (void) SetImageMask(_image,ReadPixelMask,(Image *) NULL, - _exception); - break; - } - /* Set the image mask. */ - mask=GetImageCache(_image_info,arg1,_exception); - if (mask == (Image *) NULL) - break; - (void) SetImageMask(_image,ReadPixelMask,mask,_exception); - mask=DestroyImage(mask); + CLIWandWarnReplaced("-read-mask"); + (void) CLISimpleOperatorImage(cli_wand,"-read-mask",NULL,NULL, + exception); break; } if (LocaleCompare("matte",option+1) == 0) @@ -3070,6 +3057,26 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand, (void) RandomThresholdImage(_image,arg1,_exception); break; } + if (LocaleCompare("read-mask",option+1) == 0) + { + /* Note: arguments do not have percent escapes expanded */ + Image + *mask; + + if (IfPlusOp) + { /* Remove a mask. */ + (void) SetImageMask(_image,ReadPixelMask,(Image *) NULL, + _exception); + break; + } + /* Set the image mask. */ + mask=GetImageCache(_image_info,arg1,_exception); + if (mask == (Image *) NULL) + break; + (void) SetImageMask(_image,ReadPixelMask,mask,_exception); + mask=DestroyImage(mask); + break; + } if (LocaleCompare("recolor",option+1) == 0) { CLIWandWarnReplaced("-color-matrix"); @@ -3519,6 +3526,26 @@ static MagickBooleanType CLISimpleOperatorImage(MagickCLI *cli_wand, (void) WhiteThresholdImage(_image,arg1,_exception); break; } + if (LocaleCompare("write-mask",option+1) == 0) + { + /* Note: arguments do not have percent escapes expanded */ + Image + *mask; + + if (IfPlusOp) + { /* Remove a mask. */ + (void) SetImageMask(_image,WritePixelMask,(Image *) NULL, + _exception); + break; + } + /* Set the image mask. */ + mask=GetImageCache(_image_info,arg1,_exception); + if (mask == (Image *) NULL) + break; + (void) SetImageMask(_image,WritePixelMask,mask,_exception); + mask=DestroyImage(mask); + break; + } CLIWandExceptionBreak(OptionError,"UnrecognizedOption",option); } default: diff --git a/utilities/convert.1 b/utilities/convert.1 index ae94f0411..767599f45 100644 --- a/utilities/convert.1 +++ b/utilities/convert.1 @@ -67,7 +67,6 @@ Image Settings: \-label string assign a label to an image \-limit type value pixel cache resource limit \-loop iterations add Netscape loop extension to your GIF animation - \-mask filename associate a mask with the image \-matte store matte channel if the image has one \-mattecolor color frame color \-metric type measure differences between images with this metric @@ -81,6 +80,7 @@ Image Settings: \-preview type image preview type \-quality value JPEG/MIFF/PNG compression level \-quiet suppress all warning messages + \-read-mask filename associate a read mask with the image \-red-primary point chromaticity red primary point \-regard-warnings pay attention to warning messages \-remap filename transform image colors to match this set of colors @@ -113,6 +113,7 @@ Image Settings: virtual pixel access method \-weight type render text with this font weight \-white-point point chromaticity white point + \-write-mask filename associate a write mask with the image Image Operators: \-adaptive-blur geometry diff --git a/utilities/convert.1.in b/utilities/convert.1.in index ebd9c9c09..1b352f4e4 100644 --- a/utilities/convert.1.in +++ b/utilities/convert.1.in @@ -67,7 +67,6 @@ Image Settings: \-label string assign a label to an image \-limit type value pixel cache resource limit \-loop iterations add Netscape loop extension to your GIF animation - \-mask filename associate a mask with the image \-matte store matte channel if the image has one \-mattecolor color frame color \-metric type measure differences between images with this metric @@ -81,6 +80,7 @@ Image Settings: \-preview type image preview type \-quality value JPEG/MIFF/PNG compression level \-quiet suppress all warning messages + \-read-mask filename associate a read mask with the image \-red-primary point chromaticity red primary point \-regard-warnings pay attention to warning messages \-remap filename transform image colors to match this set of colors @@ -113,6 +113,7 @@ Image Settings: virtual pixel access method \-weight type render text with this font weight \-white-point point chromaticity white point + \-write-mask filename associate a write mask with the image Image Operators: \-adaptive-blur geometry diff --git a/utilities/identify.1 b/utilities/identify.1 index 8df0696a9..5a2e83d2e 100644 --- a/utilities/identify.1 +++ b/utilities/identify.1 @@ -35,13 +35,13 @@ Image Settings: \-limit type value pixel cache resource limit \-list type Color, Configure, Delegate, Format, Magic, Module, Resource, or Type - \-mask filename associate a mask with the image \-matte store matte channel if the image has one \-moments report image moments \-monitor monitor progress \-ping efficiently determine image attributes \-precision value maximum number of significant digits to print \-quiet suppress all warning messages + \-read-mask filename associate a read mask with the image \-regard-warnings pay attention to warning messages \-respect-parentheses settings remain in effect until parenthesis boundary \-sampling-factor geometry diff --git a/utilities/identify.1.in b/utilities/identify.1.in index fd166d7cc..7c5090a1a 100644 --- a/utilities/identify.1.in +++ b/utilities/identify.1.in @@ -35,13 +35,13 @@ Image Settings: \-limit type value pixel cache resource limit \-list type Color, Configure, Delegate, Format, Magic, Module, Resource, or Type - \-mask filename associate a mask with the image \-matte store matte channel if the image has one \-moments report image moments \-monitor monitor progress \-ping efficiently determine image attributes \-precision value maximum number of significant digits to print \-quiet suppress all warning messages + \-read-mask filename associate a read mask with the image \-regard-warnings pay attention to warning messages \-respect-parentheses settings remain in effect until parenthesis boundary \-sampling-factor geometry diff --git a/utilities/mogrify.1 b/utilities/mogrify.1 index 2fe945d46..0d165f126 100644 --- a/utilities/mogrify.1 +++ b/utilities/mogrify.1 @@ -62,7 +62,6 @@ Image Settings: \-label string assign a label to an image \-limit type value pixel cache resource limit \-loop iterations add Netscape loop extension to your GIF animation - \-mask filename associate a mask with the image \-matte store matte channel if the image has one \-mattecolor color frame color \-metric type measure differences between images with this metric @@ -80,6 +79,7 @@ Image Settings: \-preview type image preview type \-quality value JPEG/MIFF/PNG compression level \-quiet suppress all warning messages + \-read-mask filename associate a read mask with the image \-red-primary point chromaticity red primary point \-regard-warnings pay attention to warning messages \-remap filename transform image colors to match this set of colors @@ -109,6 +109,7 @@ Image Settings: virtual pixel access method \-weight type render text with this font weight \-white-point point chromaticity white point + \-write-mask filename associate a write mask with the image Image Operators: \-adaptive-blur geometry diff --git a/utilities/mogrify.1.in b/utilities/mogrify.1.in index e338ae5a7..b8aa8a4ae 100644 --- a/utilities/mogrify.1.in +++ b/utilities/mogrify.1.in @@ -62,7 +62,6 @@ Image Settings: \-label string assign a label to an image \-limit type value pixel cache resource limit \-loop iterations add Netscape loop extension to your GIF animation - \-mask filename associate a mask with the image \-matte store matte channel if the image has one \-mattecolor color frame color \-metric type measure differences between images with this metric @@ -80,6 +79,7 @@ Image Settings: \-preview type image preview type \-quality value JPEG/MIFF/PNG compression level \-quiet suppress all warning messages + \-read-mask filename associate a read mask with the image \-red-primary point chromaticity red primary point \-regard-warnings pay attention to warning messages \-remap filename transform image colors to match this set of colors @@ -109,6 +109,7 @@ Image Settings: virtual pixel access method \-weight type render text with this font weight \-white-point point chromaticity white point + \-write-mask filename associate a write mask with the image Image Operators: \-adaptive-blur geometry