]> granicus.if.org Git - imagemagick/blobdiff - coders/x.c
...
[imagemagick] / coders / x.c
index 92d0e53bd3143416ff4b6f8fb0b8f0b98b5f769f..8448269ab2345d747c913fb46ceca225de1f3c09 100644 (file)
 %                    Read/Write Image from/to X11 Server.                     %
 %                                                                             %
 %                              Software Design                                %
-%                                John Cristy                                  %
+%                                   Cristy                                    %
 %                                 July 1992                                   %
 %                                                                             %
 %                                                                             %
-%  Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization      %
+%  Copyright 1999-2017 ImageMagick Studio LLC, a non-profit organization      %
 %  dedicated to making software imaging solutions freely available.           %
 %                                                                             %
 %  You may not use this file except in compliance with the License.  You may  %
@@ -56,6 +56,7 @@
 #include "MagickCore/static.h"
 #include "MagickCore/string_.h"
 #include "MagickCore/module.h"
+#include "MagickCore/token.h"
 #include "MagickCore/utility.h"
 #include "MagickCore/xwindow.h"
 #include "MagickCore/xwindow-private.h"
@@ -95,21 +96,14 @@ static MagickBooleanType
 */
 static Image *ReadXImage(const ImageInfo *image_info,ExceptionInfo *exception)
 {
-  const char
-    *option;
-
   XImportInfo
     ximage_info;
 
   (void) exception;
   XGetImportInfo(&ximage_info);
-  option=GetImageOption(image_info,"x:screen");
-  if (option != (const char *) NULL)
-    ximage_info.screen=IsMagickTrue(option);
-  option=GetImageOption(image_info,"x:silent");
-  if (option != (const char *) NULL)
-    ximage_info.silent=IsMagickTrue(option);
-  return(XImportImage(image_info,&ximage_info));
+  ximage_info.screen=IsStringTrue(GetImageOption(image_info,"x:screen"));
+  ximage_info.silent=IsStringTrue(GetImageOption(image_info,"x:silent"));
+  return(XImportImage(image_info,&ximage_info,exception));
 }
 #endif
 \f
@@ -141,14 +135,12 @@ ModuleExport size_t RegisterXImage(void)
   MagickInfo
     *entry;
 
-  entry=SetMagickInfo("X");
+  entry=AcquireMagickInfo("X","X","X Image");
 #if defined(MAGICKCORE_X11_DELEGATE)
   entry->decoder=(DecodeImageHandler *) ReadXImage;
   entry->encoder=(EncodeImageHandler *) WriteXImage;
 #endif
   entry->format_type=ImplicitFormatType;
-  entry->description=ConstantString("X Image");
-  entry->module=ConstantString("X");
   (void) RegisterMagickInfo(entry);
   return(MagickImageCoderSignature);
 }
@@ -207,5 +199,5 @@ ModuleExport void UnregisterXImage(void)
 static MagickBooleanType WriteXImage(const ImageInfo *image_info,Image *image,
   ExceptionInfo *exception)
 {
-  return(DisplayImages(image_info,image));
+  return(DisplayImages(image_info,image,exception));
 }