]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/331
authorCristy <urban-warrior@imagemagick.org>
Thu, 3 Aug 2017 16:10:44 +0000 (12:10 -0400)
committerCristy <urban-warrior@imagemagick.org>
Thu, 3 Aug 2017 16:10:44 +0000 (12:10 -0400)
MagickWand/display.c

index c7fa6d149ce2e0a610891c81a9f62df42a518891..72526a1668cbc67c9e325f95e986c4f07afeff9c 100644 (file)
@@ -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':