From: Cristy Date: Thu, 3 Aug 2017 16:10:44 +0000 (-0400) Subject: https://github.com/ImageMagick/ImageMagick/issues/331 X-Git-Tag: 7.0.6-6~34 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eab2785b8e3a643bf12a0181df9bfed562009baf;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/331 --- diff --git a/MagickWand/display.c b/MagickWand/display.c index c7fa6d149..72526a166 100644 --- a/MagickWand/display.c +++ b/MagickWand/display.c @@ -187,6 +187,7 @@ static MagickBooleanType DisplayUsage(void) "-map type display image using this Standard Colormap", "-matte store matte channel if the image has one", "-monitor monitor progress", + "-nostdin do not try to open stdin", "-page geometry size and location of an image canvas", "-profile filename add, delete, or apply an image profile", "-quality value JPEG/MIFF/PNG compression level", @@ -315,6 +316,7 @@ WandExport MagickBooleanType DisplayImageCommand(ImageInfo *image_info, MagickBooleanType fire, + nostdin, pend, respect_parenthesis; @@ -375,6 +377,7 @@ WandExport MagickBooleanType DisplayImageCommand(ImageInfo *image_info, option=(char *) NULL; pend=MagickFalse; respect_parenthesis=MagickFalse; + nostdin=MagickFalse; resource_database=(XrmDatabase) NULL; (void) ResetMagickMemory(&resource_info,0,sizeof(resource_info)); server_name=(char *) NULL; @@ -411,6 +414,8 @@ WandExport MagickBooleanType DisplayImageCommand(ImageInfo *image_info, ThrowDisplayException(OptionError,"MissingArgument",option); server_name=argv[i]; } + if (LocaleCompare("nostdin",option+1) == 0) + nostdin=MagickTrue; if ((LocaleCompare("help",option+1) == 0) || (LocaleCompare("-help",option+1) == 0)) return(DisplayUsage()); @@ -459,7 +464,7 @@ WandExport MagickBooleanType DisplayImageCommand(ImageInfo *image_info, if (image != (Image *) NULL) break; else - if (isatty(STDIN_FILENO) != MagickFalse) + if (isatty(STDIN_FILENO) != MagickFalse || (nostdin != MagickFalse)) option="logo:"; else option="-"; @@ -1422,6 +1427,8 @@ WandExport MagickBooleanType DisplayImageCommand(ImageInfo *image_info, break; if (LocaleCompare("normalize",option+1) == 0) break; + if (LocaleCompare("nostdin",option+1) == 0) + break; ThrowDisplayException(OptionError,"UnrecognizedOption",option); } case 'p':