From eab2785b8e3a643bf12a0181df9bfed562009baf Mon Sep 17 00:00:00 2001 From: Cristy Date: Thu, 3 Aug 2017 12:10:44 -0400 Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/331 --- MagickWand/display.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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': -- 2.40.0