]> granicus.if.org Git - imagemagick/blobdiff - coders/pcl.c
(no commit message)
[imagemagick] / coders / pcl.c
index d4a5f1da4ed5b17328baed2800332bb575c0c9c2..3a92922d76968456fdcb72e61b84851abbcb0875 100644 (file)
 %                      Read/Write HP PCL Printer Format                       %
 %                                                                             %
 %                              Software Design                                %
-%                                John Cristy                                  %
+%                                   Cristy                                    %
 %                                 July 1992                                   %
 %                                                                             %
 %                                                                             %
-%  Copyright 1999-2013 ImageMagick Studio LLC, a non-profit organization      %
+%  Copyright 1999-2015 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  %
@@ -351,7 +351,7 @@ static Image *ReadPCLImage(const ImageInfo *image_info,ExceptionInfo *exception)
       if (read_info->scenes != (char *) NULL)
         *read_info->scenes='\0';
     }
-  option=GetImageArtifact(image,"authenticate");
+  option=GetImageOption(image_info,"authenticate");
   if (option != (const char *) NULL)
     (void) FormatLocaleString(options+strlen(options),MaxTextExtent,
       " -sPCLPassword=%s",option);
@@ -362,8 +362,8 @@ static Image *ReadPCLImage(const ImageInfo *image_info,ExceptionInfo *exception)
     read_info->antialias != MagickFalse ? 4 : 1,
     read_info->antialias != MagickFalse ? 4 : 1,density,options,
     read_info->filename,input_filename);
-  status=SystemCommand(MagickFalse,read_info->verbose,command,exception) != 0 ?
-    MagickTrue : MagickFalse;
+  status=ExternalDelegateCommand(MagickFalse,read_info->verbose,command,
+    (char *) NULL,exception) != 0 ? MagickTrue : MagickFalse;
   image=ReadImage(read_info,exception);
   (void) RelinquishUniqueFileResource(read_info->filename);
   (void) RelinquishUniqueFileResource(input_filename);
@@ -425,9 +425,9 @@ ModuleExport size_t RegisterPCLImage(void)
   entry->decoder=(DecodeImageHandler *) ReadPCLImage;
   entry->encoder=(EncodeImageHandler *) WritePCLImage;
   entry->magick=(IsImageFormatHandler *) IsPCL;
-  entry->blob_support=MagickFalse;
-  entry->seekable_stream=MagickTrue;
-  entry->thread_support=EncoderThreadSupport;
+  entry->flags^=CoderBlobSupportFlag;
+  entry->flags^=CoderDecoderThreadSupportFlag;
+  entry->flags|=CoderSeekableStreamFlag;
   entry->description=ConstantString("Printer Control Language");
   entry->module=ConstantString("PCL");
   (void) RegisterMagickInfo(entry);
@@ -665,6 +665,9 @@ static MagickBooleanType WritePCLImage(const ImageInfo *image_info,Image *image,
   char
     buffer[MaxTextExtent];
 
+  CompressionType
+    compression;
+
   const char
     *option;
 
@@ -722,11 +725,10 @@ static MagickBooleanType WritePCLImage(const ImageInfo *image_info,Image *image,
   one=1;
   do
   {
-    if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
-      (void) TransformImageColorspace(image,sRGBColorspace,exception);
     /*
       Initialize the printer.
     */
+    (void) TransformImageColorspace(image,sRGBColorspace,exception);
     (void) WriteBlobString(image,"\033E");  /* printer reset */
     (void) WriteBlobString(image,"\033*r3F");  /* set presentation mode */
     (void) FormatLocaleString(buffer,MaxTextExtent,"\033*r%.20gs%.20gT",
@@ -787,7 +789,7 @@ static MagickBooleanType WritePCLImage(const ImageInfo *image_info,Image *image,
             (void) WriteBlobString(image,buffer);
           }
         }
-    option=GetImageArtifact(image,"pcl:fit-to-page");
+    option=GetImageOption(image_info,"pcl:fit-to-page");
     if (IfMagickTrue(IsStringTrue(option)))
       (void) WriteBlobString(image,"\033*r3A");
     else
@@ -800,7 +802,11 @@ static MagickBooleanType WritePCLImage(const ImageInfo *image_info,Image *image,
     (void) ResetMagickMemory(pixels,0,(length+1)*sizeof(*pixels));
     compress_pixels=(unsigned char *) NULL;
     previous_pixels=(unsigned char *) NULL;
-    switch (image->compression)
+
+    compression=UndefinedCompression;
+    if (image_info->compression != UndefinedCompression)
+      compression=image_info->compression;
+    switch (compression)
     {
       case NoCompression:
       {
@@ -915,7 +921,7 @@ static MagickBooleanType WritePCLImage(const ImageInfo *image_info,Image *image,
           break;
         }
       }
-      switch (image->compression)
+      switch (compression)
       {
         case NoCompression:
         {
@@ -952,7 +958,7 @@ static MagickBooleanType WritePCLImage(const ImageInfo *image_info,Image *image,
       }
     }
     (void) WriteBlobString(image,"\033*rB");  /* end graphics */
-    switch (image->compression)
+    switch (compression)
     {
       case NoCompression:
         break;