🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sources.bugs
Article #661

ImageMagick 2.2 - patch #3

#661
From: Cristy
Date: Thu, 24 Dec 1992 03:34
2099 lines
65677 bytes
                    ImageMagick 2.2 Patch #3

To apply this patch:

cd to the top of the source tree (to the directory containing the
"ImageMagick" subdirectories) and do:

  patch -p < ThisFile

Prereq: ImageMagick 2.2.2 (posted from comp.sources.misc, Volume 34,
Issue 28 + Patch 1 & 2).

Alternatively get the entire distribution as contrib/ImageMagick.tar.Z
on export.lcs.mit.edu.  I will post this patch to comp.sources.misc in
a few days.


diff -r -c ImageMagick/ChangeLog ImageMagick2.2.3/ChangeLog
*** ImageMagick/ChangeLog	Tue Dec 22 16:07:20 1992
--- ImageMagick2.2.3/ChangeLog	Wed Dec 23 18:10:05 1992
***************
*** 1,3 ****
--- 1,12 ----
+ ImageMagick 2.2.3
+ 
+   o Non-color reduced images were being written even though the color
+     reduction option was specified (-colors).  This affected images written
+     as AVS, CMYK, and RGB.
+ 
+   o Modified various sources to reduce lint warnings.
+ 
+ 
  ImageMagick 2.2.2
  
    o Dithering did not work properly on the Cray (due to right shift problem).
diff -r -c ImageMagick/X.c ImageMagick2.2.3/X.c
*** ImageMagick/X.c	Tue Dec 22 16:06:18 1992
--- ImageMagick2.2.3/X.c	Wed Dec 23 18:10:01 1992
***************
*** 73,81 ****
--- 73,89 ----
  int
    Latin1Compare _Declare((char *,char *));
  
+ static unsigned int
+   XReadColormap _Declare((Display *,XWindowAttributes *,XColor **));
+ 
  static void
    XMakeImageLSBFirst _Declare((XWindowInfo *,Image *, XImage *)),
    XMakeImageMSBFirst _Declare((XWindowInfo *,Image *, XImage *));
+ 
+ static Window
+   XClientWindow _Declare((Display *,Window)),
+   XSelectWindow _Declare((Display *,XRectangle *)),
+   XWindowByProperty _Declare((Display *,Window,Atom));
  
  /*
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
***************
*** 221,227 ****
  %
  %
  */
! void Latin1Upper(string)
  char
    *string;
  {
--- 229,235 ----
  %
  %
  */
! static void Latin1Upper(string)
  char
    *string;
  {
***************
*** 1296,1302 ****
      Initialize graphics info.
    */
    graphic_context_value.background=0;
!   graphic_context_value.foreground=(~0);
    graphic_context_value.font=annotate_info->font_info->fid;
    graphic_context=XCreateGC(display,window->id,GCBackground | GCFont |
      GCForeground,&graphic_context_value);
--- 1304,1310 ----
      Initialize graphics info.
    */
    graphic_context_value.background=0;
!   graphic_context_value.foreground=(unsigned long) (~0);
    graphic_context_value.font=annotate_info->font_info->fid;
    graphic_context=XCreateGC(display,window->id,GCBackground | GCFont |
      GCForeground,&graphic_context_value);
***************
*** 1711,1717 ****
      Find closest representation for the requested RGB color.
    */
    color->pixel=0;
!   min_distance=(~0);
    for (i=0; i < number_colors; i++)
    {
      red_distance=(colors[i].red >> 8)-(color->red >> 8);
--- 1719,1725 ----
      Find closest representation for the requested RGB color.
    */
    color->pixel=0;
!   min_distance=(unsigned long) (~0);
    for (i=0; i < number_colors; i++)
    {
      red_distance=(colors[i].red >> 8)-(color->red >> 8);
***************
*** 2019,2025 ****
  %
  %
  */
! Window XClientWindow(display,target_window)
  Display
    *display;
  
--- 2027,2033 ----
  %
  %
  */
! static Window XClientWindow(display,target_window)
  Display
    *display;
  
***************
*** 2993,2999 ****
                /*
                  Advance to the next scanline.
                */
!               if (bit > 0)
                  *q=byte >> (8-bit);
                q+=scanline_pad;
                bit=0;
--- 3001,3007 ----
                /*
                  Advance to the next scanline.
                */
!               if (bit != 0)
                  *q=byte >> (8-bit);
                q+=scanline_pad;
                bit=0;
***************
*** 3484,3490 ****
                /*
                  Advance to the next scanline.
                */
!               if (bit > 0)
                  *q=byte << (8-bit);
                q+=scanline_pad;
                bit=0;
--- 3492,3498 ----
                /*
                  Advance to the next scanline.
                */
!               if (bit != 0)
                  *q=byte << (8-bit);
                q+=scanline_pad;
                bit=0;
***************
*** 5357,5363 ****
          status=XGetWindowProperty(display,XRootWindow(display,0),XA_CUT_BUFFER0,
            0L,2047L,False,XA_STRING,&type,&format,&length,&after,&data);
          if ((status != Success) || (type != XA_STRING) || (format == 32) ||
!             (length <= 0))
            break;
          /*
            Append cut buffer to reply.
--- 5365,5371 ----
          status=XGetWindowProperty(display,XRootWindow(display,0),XA_CUT_BUFFER0,
            0L,2047L,False,XA_STRING,&type,&format,&length,&after,&data);
          if ((status != Success) || (type != XA_STRING) || (format == 32) ||
!             (length == 0))
            break;
          /*
            Append cut buffer to reply.
***************
*** 5527,5533 ****
  %
  %
  */
! unsigned int XReadColormap(display,window_attributes,colors)
  Display
    *display;
  
--- 5535,5541 ----
  %
  %
  */
! static unsigned int XReadColormap(display,window_attributes,colors)
  Display
    *display;
  
***************
*** 5727,5733 ****
  %
  %
  */
! Window XSelectWindow(display,clip_info)
  Display
    *display;
  
--- 5735,5741 ----
  %
  %
  */
! static Window XSelectWindow(display,clip_info)
  Display
    *display;
  
***************
*** 6102,6108 ****
  %
  %
  */
! Window XWindowByProperty(display,window,property)
  Display
    *display;
  
--- 6110,6116 ----
  %
  %
  */
! static Window XWindowByProperty(display,window,property)
  Display
    *display;
  
diff -r -c ImageMagick/X.h ImageMagick2.2.3/X.h
*** ImageMagick/X.h	Tue Dec 22 16:04:15 1992
--- ImageMagick2.2.3/X.h	Wed Dec 23 18:10:04 1992
***************
*** 266,279 ****
      unsigned int,unsigned int)),
    XMakePixmap _Declare((Display *,XResourceInfo *,XWindowInfo *)),
    XPopupMenu _Declare((Display *,XWindowInfo *,int,int,char *,char **,
!     unsigned int,char *)),
!   XReadColormap _Declare((Display *,XWindowAttributes *,XColor **));
  
  extern XVisualInfo 
    *XBestVisualInfo _Declare((Display *,char *,char *,XStandardColormap *));
  
  extern void 
-   Latin1Upper _Declare((char *)),
    XBestIconSize _Declare((Display *,XWindowInfo *,Image *)),
    XFreeStandardColormap _Declare((Display *,XVisualInfo *,XPixelInfo *,
      XStandardColormap *)),
--- 266,277 ----
      unsigned int,unsigned int)),
    XMakePixmap _Declare((Display *,XResourceInfo *,XWindowInfo *)),
    XPopupMenu _Declare((Display *,XWindowInfo *,int,int,char *,char **,
!     unsigned int,char *));
  
  extern XVisualInfo 
    *XBestVisualInfo _Declare((Display *,char *,char *,XStandardColormap *));
  
  extern void 
    XBestIconSize _Declare((Display *,XWindowInfo *,Image *)),
    XFreeStandardColormap _Declare((Display *,XVisualInfo *,XPixelInfo *,
      XStandardColormap *)),
***************
*** 291,299 ****
    XRefreshWindow _Declare((Display *,XWindowInfo *,XEvent *));
  
  extern Window 
-   XClientWindow _Declare((Display *,Window)),
-   XWindowByProperty _Declare((Display *,Window,Atom)),
-   XSelectWindow _Declare((Display *,XRectangle *)),
    XWindowByID _Declare((Display *,Window,unsigned long)),
    XWindowByName _Declare((Display *,Window,char *));
  
--- 289,294 ----
diff -r -c ImageMagick/XtoPS.c ImageMagick2.2.3/XtoPS.c
*** ImageMagick/XtoPS.c	Tue Dec 22 16:04:16 1992
--- ImageMagick2.2.3/XtoPS.c	Wed Dec 23 18:10:01 1992
***************
*** 428,434 ****
    /*
      Read image from X server.
    */
!   if (resource_info.delay > 0)
      (void) sleep(resource_info.delay);
    start_time=time((time_t *) 0);
    image=ReadXImage(target_window,server_name,frame,screen,borders);
--- 428,434 ----
    /*
      Read image from X server.
    */
!   if (resource_info.delay != 0)
      (void) sleep(resource_info.delay);
    start_time=time((time_t *) 0);
    image=ReadXImage(target_window,server_name,frame,screen,borders);
***************
*** 469,475 ****
          (void) fprintf(stderr," DirectClass ");
        else
          (void) fprintf(stderr," PseudoClass ");
!       (void) fprintf(stderr,"%uc %s %ds\n",image->colors,image->magick,
          time((time_t *) 0)-start_time+1);
      }
    DestroyImage(image);
--- 469,475 ----
          (void) fprintf(stderr," DirectClass ");
        else
          (void) fprintf(stderr," PseudoClass ");
!       (void) fprintf(stderr,"%uc %s %lds\n",image->colors,image->magick,
          time((time_t *) 0)-start_time+1);
      }
    DestroyImage(image);
diff -r -c ImageMagick/alien.c ImageMagick2.2.3/alien.c
*** ImageMagick/alien.c	Tue Dec 22 16:04:18 1992
--- ImageMagick2.2.3/alien.c	Wed Dec 23 18:10:02 1992
***************
*** 665,671 ****
      /*
        Read image attributes.
      */
!     if (image_count > 0)
        {
          /*
            Allocate image structure.
--- 665,671 ----
      /*
        Read image attributes.
      */
!     if (image_count != 0)
        {
          /*
            Allocate image structure.
***************
*** 2264,2270 ****
          if ((number_planes % 2) == 0)
            (void) fgetc(image->file);
        }
!     if (number_colormaps > 0)
        {
          /*
            Read image colormaps.
--- 2264,2270 ----
          if ((number_planes % 2) == 0)
            (void) fgetc(image->file);
        }
!     if (number_colormaps != 0)
        {
          /*
            Read image colormaps.
***************
*** 2457,2463 ****
        }
        opcode=fgetc(image->file);
      }
!     if (number_colormaps > 0)
        {
          unsigned char
            pixel;
--- 2457,2463 ----
        }
        opcode=fgetc(image->file);
      }
!     if (number_colormaps != 0)
        {
          unsigned char
            pixel;
***************
*** 4094,4100 ****
    /*
      Read colormap.
    */
!   if (header.ncolors > 0)
      {
        colors=(XColor *) malloc((unsigned int) header.ncolors*sizeof(XColor));
        if (colors == (XColor *) NULL)
--- 4094,4100 ----
    /*
      Read colormap.
    */
!   if (header.ncolors != 0)
      {
        colors=(XColor *) malloc((unsigned int) header.ncolors*sizeof(XColor));
        if (colors == (XColor *) NULL)
***************
*** 4288,4294 ****
      Free image and colormap.
    */
    (void) free((char *) window_name);
!   if (header.ncolors > 0)
      (void) free((char *) colors);
    XDestroyImage(ximage);
    CloseImage(image);
--- 4288,4294 ----
      Free image and colormap.
    */
    (void) free((char *) window_name);
!   if (header.ncolors != 0)
      (void) free((char *) colors);
    XDestroyImage(ximage);
    CloseImage(image);
***************
*** 5227,5233 ****
                /*
                  Advance to the next scanline.
                */
!               if (bit > 0)
                  *q++=byte << (8-bit);
                bit=0;
                byte=0;
--- 5227,5233 ----
                /*
                  Advance to the next scanline.
                */
!               if (bit != 0)
                  *q++=byte << (8-bit);
                bit=0;
                byte=0;
***************
*** 5255,5290 ****
      }
      case '6':
      {
-       unsigned short int
-         index;
- 
        /*
          Convert image to a PNM image.
        */
        (void) fprintf(image->file,"%d\n",MaxRGB);
!       if (image->class == DirectClass)
!         for (i=0; i < image->packets; i++)
          {
!           for (j=0; j <= ((int) p->length); j++)
!           {
!             *q++=p->red;
!             *q++=p->green;
!             *q++=p->blue;
!           }
!           p++;
          }
!       else
!         for (i=0; i < image->packets; i++)
!         {
!           for (j=0; j <= ((int) p->length); j++)
!           {
!             index=p->index;
!             *q++=image->colormap[index].red;
!             *q++=image->colormap[index].green;
!             *q++=image->colormap[index].blue;
!           }
!           p++;
!         }
        break;
      }
    }
--- 5255,5274 ----
      }
      case '6':
      {
        /*
          Convert image to a PNM image.
        */
        (void) fprintf(image->file,"%d\n",MaxRGB);
!       for (i=0; i < image->packets; i++)
!       {
!         for (j=0; j <= ((int) p->length); j++)
          {
!           *q++=p->red;
!           *q++=p->green;
!           *q++=p->blue;
          }
!         p++;
!       }
        break;
      }
    }
***************
*** 5627,5633 ****
                    /*
                      Advance to the next scanline.
                    */
!                   if (bit > 0)
                      *q++=byte << (8-bit);
                    if (TIFFWriteScanline(file,scanline,y,0) < 0)
                      break;
--- 5611,5617 ----
                    /*
                      Advance to the next scanline.
                    */
!                   if (bit != 0)
                      *q++=byte << (8-bit);
                    if (TIFFWriteScanline(file,scanline,y,0) < 0)
                      break;
***************
*** 5643,5649 ****
          }
    (void) free((char *) scanline);
    (void) TIFFFlushData(file);
!   if (verbose)
      TIFFPrintDirectory(file,stderr,False);
    (void) TIFFClose(file);
    return(True);
--- 5627,5633 ----
          }
    (void) free((char *) scanline);
    (void) TIFFFlushData(file);
!   if (verbose == True)
      TIFFPrintDirectory(file,stderr,False);
    (void) TIFFClose(file);
    return(True);
***************
*** 5930,5936 ****
                  /*
                    Advance to the next scanline.
                  */
!                 if (bit > 0)
                    *q++=byte << (8-bit);
                  if ((((image->columns/8)+
                      (image->columns % 8 ? 1 : 0)) % 2) != 0)
--- 5914,5920 ----
                  /*
                    Advance to the next scanline.
                  */
!                 if (bit != 0)
                    *q++=byte << (8-bit);
                  if ((((image->columns/8)+
                      (image->columns % 8 ? 1 : 0)) % 2) != 0)
***************
*** 6065,6071 ****
        x++;
        if (x == image->columns)
          {
!           if (bit > 0)
              {
                /*
                  Write a bitmap byte to the image file.
--- 6049,6055 ----
        x++;
        if (x == image->columns)
          {
!           if (bit != 0)
              {
                /*
                  Write a bitmap byte to the image file.
diff -r -c ImageMagick/animate.c ImageMagick2.2.3/animate.c
*** ImageMagick/animate.c	Tue Dec 22 16:04:19 1992
--- ImageMagick2.2.3/animate.c	Wed Dec 23 18:10:02 1992
***************
*** 169,175 ****
  {
  }
  
! void Delay(milliseconds)
  unsigned long
    milliseconds;
  {
--- 169,175 ----
  {
  }
  
! static void Delay(milliseconds)
  unsigned long
    milliseconds;
  {
***************
*** 1967,1972 ****
--- 1967,1976 ----
        }
      else
        {
+         double
+           normalized_maximum_error,
+           normalized_mean_error;
+ 
          Image
            *image,
            info_image,
***************
*** 1975,1980 ****
--- 1979,1987 ----
          time_t
            start_time;
  
+         unsigned int
+           mean_error_per_pixel;
+ 
          unsigned long
            total_colors;
  
***************
*** 1992,1997 ****
--- 1999,2005 ----
          do
          {
            info_image=(*image);
+           total_colors=0;
            /*
              Transform image as defined by the clip, image and scale geometries.
            */
***************
*** 2029,2053 ****
              }
            if (gamma > 0.0)
              GammaImage(image,gamma);
-           if (verbose)
-             {
-               /*
-                 Initialize image error attributes.
-               */
-               if (image->class == DirectClass)
-                 image->colors=NumberColors(image,(FILE *) NULL);
-               total_colors=image->colors;
-             }
            if (resource_info.colorspace == GRAYColorspace)
              QuantizeImage(image,256,8,resource_info.dither,GRAYColorspace,True);
            if (resource_info.monochrome)
              QuantizeImage(image,2,8,resource_info.dither,GRAYColorspace,True);
!           if (resource_info.number_colors > 0)
              if ((image->class == DirectClass) ||
                  (image->colors > resource_info.number_colors))
!               QuantizeImage(image,resource_info.number_colors,
!                 resource_info.tree_depth,resource_info.dither,
!                 resource_info.colorspace,True);
            if (verbose)
              {
                /*
--- 2037,2067 ----
              }
            if (gamma > 0.0)
              GammaImage(image,gamma);
            if (resource_info.colorspace == GRAYColorspace)
              QuantizeImage(image,256,8,resource_info.dither,GRAYColorspace,True);
            if (resource_info.monochrome)
              QuantizeImage(image,2,8,resource_info.dither,GRAYColorspace,True);
!           if (resource_info.number_colors != 0)
              if ((image->class == DirectClass) ||
                  (image->colors > resource_info.number_colors))
!               {
!                 /*
!                   Reduce the number of colors in the image.
!                 */
!                 QuantizeImage(image,resource_info.number_colors,
!                   resource_info.tree_depth,resource_info.dither,
!                   resource_info.colorspace,True);
!                 if (verbose)
!                   {
!                     /*
!                       Measure quantization error.
!                     */
!                     QuantizationError(image,&mean_error_per_pixel,
!                       &normalized_mean_error,&normalized_maximum_error);
!                     total_colors=NumberColors(image,(FILE *) NULL);
!                   }
!                 SyncImage(image);
!               }
            if (verbose)
              {
                /*
***************
*** 2065,2087 ****
                  (void) fprintf(stderr," DirectClass ");
                else
                  (void) fprintf(stderr," PseudoClass ");
!               if (total_colors != image->colors)
!                 (void) fprintf(stderr,"%lu=>",total_colors);
!               (void) fprintf(stderr,"%uc",image->colors);
!               if ((resource_info.number_colors > 0) || resource_info.monochrome)
                  {
!                   double
!                     normalized_maximum_error,
!                     normalized_mean_error;
! 
!                   unsigned int
!                     mean_error_per_pixel;
! 
!                   /*
!                     Measure quantization error.
!                   */
!                   QuantizationError(image,&mean_error_per_pixel,
!                     &normalized_mean_error,&normalized_maximum_error);
                    (void) fprintf(stderr," %u/%.6f/%.6fe",mean_error_per_pixel,
                      normalized_mean_error,normalized_maximum_error);
                  }
--- 2079,2089 ----
                  (void) fprintf(stderr," DirectClass ");
                else
                  (void) fprintf(stderr," PseudoClass ");
!               if (total_colors == 0)
!                 (void) fprintf(stderr,"%uc",image->colors);
!               else
                  {
!                   (void) fprintf(stderr,"%lu=>%uc",total_colors,image->colors);
                    (void) fprintf(stderr," %u/%.6f/%.6fe",mean_error_per_pixel,
                      normalized_mean_error,normalized_maximum_error);
                  }
diff -r -c ImageMagick/colors.c ImageMagick2.2.3/colors.c
*** ImageMagick/colors.c	Tue Dec 22 16:04:19 1992
--- ImageMagick2.2.3/colors.c	Wed Dec 23 18:10:02 1992
***************
*** 156,162 ****
      if (node->child[id] != (Node *) NULL)
        Histogram(node->child[id],file);
    if (node->level == MaxTreeDepth)
!     (void) fprintf(file,"%8d\t%d\t%d\t%d\n",node->number_colors,
        node->mid_red,node->mid_green,node->mid_blue);
  }
  
--- 156,162 ----
      if (node->child[id] != (Node *) NULL)
        Histogram(node->child[id],file);
    if (node->level == MaxTreeDepth)
!     (void) fprintf(file,"%8lu\t%d\t%d\t%d\n",node->number_colors,
        node->mid_red,node->mid_green,node->mid_blue);
  }
  
diff -r -c ImageMagick/compress.c ImageMagick2.2.3/compress.c
*** ImageMagick/compress.c	Tue Dec 22 16:04:20 1992
--- ImageMagick2.2.3/compress.c	Wed Dec 23 18:10:02 1992
***************
*** 1078,1084 ****
        k=((int) (p->index) << (MaxLZWBits-8))+waiting_code;
        if (k >= MaxHashTable)
          k-=MaxHashTable;
!       if (hash_code[k] != 0)
          {
            if ((hash_prefix[k] == waiting_code) &&
                (hash_suffix[k] == (unsigned char) (p->index & 0xff)))
--- 1078,1084 ----
        k=((int) (p->index) << (MaxLZWBits-8))+waiting_code;
        if (k >= MaxHashTable)
          k-=MaxHashTable;
!       if (hash_code[k] >= 0)
          {
            if ((hash_prefix[k] == waiting_code) &&
                (hash_suffix[k] == (unsigned char) (p->index & 0xff)))
diff -r -c ImageMagick/display.c ImageMagick2.2.3/display.c
*** ImageMagick/display.c	Tue Dec 22 16:04:22 1992
--- ImageMagick2.2.3/display.c	Wed Dec 23 18:10:03 1992
***************
*** 625,633 ****
        if (resource_info->number_colors > 0)
          if ((output_image->class == DirectClass) ||
              (output_image->colors > resource_info->number_colors))
!           QuantizeImage(output_image,resource_info->number_colors,
!             resource_info->tree_depth,resource_info->dither,
!             resource_info->colorspace,True);
        (void) strcpy(output_image->filename,filename);
        if (command == 'p')
          (void) PrintImage(output_image,resource_info->image_geometry);
--- 625,636 ----
        if (resource_info->number_colors > 0)
          if ((output_image->class == DirectClass) ||
              (output_image->colors > resource_info->number_colors))
!           {
!             QuantizeImage(output_image,resource_info->number_colors,
!               resource_info->tree_depth,resource_info->dither,
!               resource_info->colorspace,True);
!             SyncImage(output_image);
!           }
        (void) strcpy(output_image->filename,filename);
        if (command == 'p')
          (void) PrintImage(output_image,resource_info->image_geometry);
***************
*** 668,674 ****
        break;
      }
    }
!   if ((width > 0) && (height > 0))
      {
        unsigned int
          mask;
--- 671,677 ----
        break;
      }
    }
!   if ((width != 0) && (height != 0))
      {
        unsigned int
          mask;
***************
*** 2193,2199 ****
        /*
          Free previous resources on the root window.
        */
!       XKillClient(display,*((Pixmap *) data));
        XFree((void *) data);
      }
    /*
--- 2196,2202 ----
        /*
          Free previous resources on the root window.
        */
!       XKillClient(display,(XID) (*((Pixmap *) data)));
        XFree((void *) data);
      }
    /*
***************
*** 2926,2932 ****
    *state&=(~NextImageState);
    *state&=(~TileImageState);
    if (resource_info->delay == 0)
!     timeout=(~0);
    else
      timeout=(unsigned long) time((time_t *) 0)+resource_info->delay;
    do
--- 2929,2935 ----
    *state&=(~NextImageState);
    *state&=(~TileImageState);
    if (resource_info->delay == 0)
!     timeout=(unsigned long) (~0);
    else
      timeout=(unsigned long) time((time_t *) 0)+resource_info->delay;
    do
***************
*** 3179,3185 ****
                  Reset timeout after expose.
                */
                if (resource_info->delay == 0)
!                 timeout=(~0);
                else
                  timeout=(unsigned long) time((time_t *) 0)+resource_info->delay;
                break;
--- 3182,3188 ----
                  Reset timeout after expose.
                */
                if (resource_info->delay == 0)
!                 timeout=(unsigned long) (~0);
                else
                  timeout=(unsigned long) time((time_t *) 0)+resource_info->delay;
                break;
***************
*** 3513,3521 ****
        if (resource_info->number_colors > 0)
          if ((displayed_image->class == DirectClass) ||
              (displayed_image->colors > resource_info->number_colors))
!           QuantizeImage(displayed_image,resource_info->number_colors,
!             resource_info->tree_depth,resource_info->dither,
!             resource_info->colorspace,True);
      }
    /*
      Free X resources.
--- 3516,3527 ----
        if (resource_info->number_colors > 0)
          if ((displayed_image->class == DirectClass) ||
              (displayed_image->colors > resource_info->number_colors))
!           {
!             QuantizeImage(displayed_image,resource_info->number_colors,
!               resource_info->tree_depth,resource_info->dither,
!               resource_info->colorspace,True);
!             SyncImage(displayed_image);
!           }
      }
    /*
      Free X resources.
***************
*** 4109,4115 ****
                      p++;
                      p_bit=0;
                    }
!                 if (q_bit > 0)
                    *q=byte >> (8-q_bit);
                  q+=scanline_pad;
                }
--- 4115,4121 ----
                      p++;
                      p_bit=0;
                    }
!                 if (q_bit != 0)
                    *q=byte >> (8-q_bit);
                  q+=scanline_pad;
                }
***************
*** 4166,4172 ****
                      p++;
                      p_bit=0;
                    }
!                 if (q_bit > 0)
                    *q=byte << (8-q_bit);
                  q+=scanline_pad;
                }
--- 4172,4178 ----
                      p++;
                      p_bit=0;
                    }
!                 if (q_bit != 0)
                    *q=byte << (8-q_bit);
                  q+=scanline_pad;
                }
***************
*** 5556,5561 ****
--- 5562,5571 ----
        }
      else
        {
+         double
+           normalized_maximum_error,
+           normalized_mean_error;
+ 
          Image
            *image,
            info_image,
***************
*** 5564,5570 ****
          time_t
            start_time;
  
!         unsigned long
            total_colors;
  
          /*
--- 5574,5583 ----
          time_t
            start_time;
  
!         unsigned int
!           mean_error_per_pixel;
! 
!         unsigned long int
            total_colors;
  
          /*
***************
*** 5581,5588 ****
          do
          {
            info_image=(*image);
!           if (scene > 0)
              image->scene=scene;
            /*
              Transform image as defined by the clip, image and scale geometries.
            */
--- 5594,5602 ----
          do
          {
            info_image=(*image);
!           if (scene != 0)
              image->scene=scene;
+           total_colors=0;
            /*
              Transform image as defined by the clip, image and scale geometries.
            */
***************
*** 5654,5678 ****
              InverseImage(image);
            if (normalize)
              NormalizeImage(image);
-           if (verbose)
-             {
-               /*
-                 Initialize image error attributes.
-               */
-               if (image->class == DirectClass)
-                 image->colors=NumberColors(image,(FILE *) NULL);
-               total_colors=image->colors;
-             }
            if (resource_info.colorspace == GRAYColorspace)
              QuantizeImage(image,256,8,resource_info.dither,GRAYColorspace,True);
            if (resource_info.monochrome)
              QuantizeImage(image,2,8,resource_info.dither,GRAYColorspace,True);
!           if (resource_info.number_colors > 0)
              if ((image->class == DirectClass) ||
                  (image->colors > resource_info.number_colors))
!               QuantizeImage(image,resource_info.number_colors,
!                 resource_info.tree_depth,resource_info.dither,
!                 resource_info.colorspace,True);
            /*
              Display image to X server.
            */
--- 5668,5698 ----
              InverseImage(image);
            if (normalize)
              NormalizeImage(image);
            if (resource_info.colorspace == GRAYColorspace)
              QuantizeImage(image,256,8,resource_info.dither,GRAYColorspace,True);
            if (resource_info.monochrome)
              QuantizeImage(image,2,8,resource_info.dither,GRAYColorspace,True);
!           if (resource_info.number_colors != 0)
              if ((image->class == DirectClass) ||
                  (image->colors > resource_info.number_colors))
!               {
!                 /*
!                   Reduce the number of colors in the image.
!                 */
!                 QuantizeImage(image,resource_info.number_colors,
!                   resource_info.tree_depth,resource_info.dither,
!                   resource_info.colorspace,True);
!                 if (verbose)
!                   {
!                     /*
!                       Measure quantization error.
!                     */
!                     QuantizationError(image,&mean_error_per_pixel,
!                       &normalized_mean_error,&normalized_maximum_error);
!                     total_colors=NumberColors(image,(FILE *) NULL);
!                   }
!                 SyncImage(image);
!               }
            /*
              Display image to X server.
            */
***************
*** 5744,5766 ****
                  (void) fprintf(stderr," DirectClass ");
                else
                  (void) fprintf(stderr," PseudoClass ");
!               if (total_colors != image->colors)
!                 (void) fprintf(stderr,"%lu=>",total_colors);
!               (void) fprintf(stderr,"%uc",image->colors);
!               if ((resource_info.number_colors > 0) || resource_info.monochrome)
                  {
!                   double
!                     normalized_maximum_error,
!                     normalized_mean_error;
! 
!                   unsigned int
!                     mean_error_per_pixel;
! 
!                   /*
!                     Measure quantization error.
!                   */
!                   QuantizationError(image,&mean_error_per_pixel,
!                     &normalized_mean_error,&normalized_maximum_error);
                    (void) fprintf(stderr," %u/%.6f/%.6fe",mean_error_per_pixel,
                      normalized_mean_error,normalized_maximum_error);
                  }
--- 5764,5774 ----
                  (void) fprintf(stderr," DirectClass ");
                else
                  (void) fprintf(stderr," PseudoClass ");
!               if (total_colors == 0)
!                 (void) fprintf(stderr,"%uc",image->colors);
!               else
                  {
!                   (void) fprintf(stderr,"%lu=>%uc",total_colors,image->colors);
                    (void) fprintf(stderr," %u/%.6f/%.6fe",mean_error_per_pixel,
                      normalized_mean_error,normalized_maximum_error);
                  }
***************
*** 5791,5797 ****
              for (i--; i > 0; i--)
                if (image_marker[i] == (image_number-2))
                  break;
!             if (image_number > 0)
                image_number--;
            }
        }
--- 5799,5805 ----
              for (i--; i > 0; i--)
                if (image_marker[i] == (image_number-2))
                  break;
!             if (image_number != 0)
                image_number--;
            }
        }
diff -r -c ImageMagick/display.h ImageMagick2.2.3/display.h
*** ImageMagick/display.h	Tue Dec 22 16:23:32 1992
--- ImageMagick2.2.3/display.h	Wed Dec 23 18:10:04 1992
***************
*** 51,55 ****
  */
  #ifndef lint
  static char 
!   Version[]="@(#)ImageMagick 2.2.2 92/12/22 cristy@dupont.com";
  #endif
--- 51,55 ----
  */
  #ifndef lint
  static char 
!   Version[]="@(#)ImageMagick 2.2.3 93/01/01 cristy@dupont.com";
  #endif
diff -r -c ImageMagick/image.c ImageMagick2.2.3/image.c
*** ImageMagick/image.c	Tue Dec 22 16:06:19 1992
--- ImageMagick2.2.3/image.c	Wed Dec 23 18:10:03 1992
***************
*** 62,67 ****
--- 62,73 ----
    *client_name;
  
  /*
+   Forward declarations.
+ */
+ static Image
+   *ZoomImage _Declare((Image *));
+ 
+ /*
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  %                                                                             %
  %                                                                             %
***************
*** 1597,1605 ****
      }
      case PseudoClass:
      {
-       register unsigned short
-         index;
- 
        /*
          Gamma-correct PseudoClass image.
        */
--- 1603,1608 ----
***************
*** 1609,1623 ****
          image->colormap[i].green=gamma_map[image->colormap[i].green];
          image->colormap[i].blue=gamma_map[image->colormap[i].blue];
        }
!       p=image->pixels;
!       for (i=0; i < image->packets; i++)
!       {
!         index=p->index;
!         p->red=image->colormap[index].red;
!         p->green=image->colormap[index].green;
!         p->blue=image->colormap[index].blue;
!         p++;
!       }
        break;
      }
    }
--- 1612,1618 ----
          image->colormap[i].green=gamma_map[image->colormap[i].green];
          image->colormap[i].blue=gamma_map[image->colormap[i].blue];
        }
!       SyncImage(image);
        break;
      }
    }
***************
*** 1675,1683 ****
      }
      case PseudoClass:
      {
-       register unsigned short
-         index;
- 
        /*
          Inverse PseudoClass packets.
        */
--- 1670,1675 ----
***************
*** 1687,1701 ****
          image->colormap[i].green=(~image->colormap[i].green);
          image->colormap[i].blue=(~image->colormap[i].blue);
        }
!       p=image->pixels;
!       for (i=0; i < image->packets; i++)
!       {
!         index=p->index;
!         p->red=image->colormap[index].red;
!         p->green=image->colormap[index].green;
!         p->blue=image->colormap[index].blue;
!         p++;
!       }
        break;
      }
    }
--- 1679,1685 ----
          image->colormap[i].green=(~image->colormap[i].green);
          image->colormap[i].blue=(~image->colormap[i].blue);
        }
!       SyncImage(image);
        break;
      }
    }
***************
*** 2032,2038 ****
        break;
    }
    intensity=0;
!   for (high=MaxRGB; high > 0; high--)
    {
      intensity+=histogram[high];
      if (intensity > threshold_intensity)
--- 2016,2022 ----
        break;
    }
    intensity=0;
!   for (high=MaxRGB; high != 0; high--)
    {
      intensity+=histogram[high];
      if (intensity > threshold_intensity)
***************
*** 2052,2058 ****
            break;
        }
        intensity=0;
!       for (high=MaxRGB; high > 0; high--)
        {
          intensity+=histogram[high];
          if (intensity > threshold_intensity)
--- 2036,2042 ----
            break;
        }
        intensity=0;
!       for (high=MaxRGB; high != 0; high--)
        {
          intensity+=histogram[high];
          if (intensity > threshold_intensity)
***************
*** 2094,2102 ****
      }
      case PseudoClass:
      {
-       register unsigned short
-         index;
- 
        /*
          Normalize PseudoClass image.
        */
--- 2078,2083 ----
***************
*** 2106,2120 ****
          image->colormap[i].green=normalize_map[image->colormap[i].green];
          image->colormap[i].blue=normalize_map[image->colormap[i].blue];
        }
!       p=image->pixels;
!       for (i=0; i < image->packets; i++)
!       {
!         index=p->index;
!         p->red=image->colormap[index].red;
!         p->green=image->colormap[index].green;
!         p->blue=image->colormap[index].blue;
!         p++;
!       }
        break;
      }
    }
--- 2087,2093 ----
          image->colormap[i].green=normalize_map[image->colormap[i].green];
          image->colormap[i].blue=normalize_map[image->colormap[i].blue];
        }
!       SyncImage(image);
        break;
      }
    }
***************
*** 3502,3508 ****
  %
  %
  */
! Image *ReduceImage(image)
  Image
    *image;
  {
--- 3475,3481 ----
  %
  %
  */
! static Image *ReduceImage(image)
  Image
    *image;
  {
***************
*** 4005,4013 ****
      }
      case PseudoClass:
      {
-       register unsigned short
-         index;
- 
        /*
          Convert PseudoClass image.
        */
--- 3978,3983 ----
***************
*** 4023,4037 ****
          image->colormap[i].blue=
            range_limit[DownShift(x[red+Z]+y[green+Z]+z[blue+Z]+tz)];
        }
!       p=image->pixels;
!       for (i=0; i < image->packets; i++)
!       {
!         index=p->index;
!         p->red=image->colormap[index].red;
!         p->green=image->colormap[index].green;
!         p->blue=image->colormap[index].blue;
!         p++;
!       }
        break;
      }
    }
--- 3993,3999 ----
          image->colormap[i].blue=
            range_limit[DownShift(x[red+Z]+y[green+Z]+z[blue+Z]+tz)];
        }
!       SyncImage(image);
        break;
      }
    }
***************
*** 4082,4088 ****
  Image
    *image;
  
! unsigned int
    x_offset,
    y_offset;
  {
--- 4044,4050 ----
  Image
    *image;
  
! int
    x_offset,
    y_offset;
  {
***************
*** 4540,4545 ****
--- 4502,4554 ----
    return(stereo_image);
  }
  
+ /*
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ %                                                                             %
+ %                                                                             %
+ %                                                                             %
+ %   S y n c I m a g e                                                         %
+ %                                                                             %
+ %                                                                             %
+ %                                                                             %
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ %
+ %  Function SyncImage initializes the red, green, and blue intensities of each
+ %  pixel as defined by the colormap index.
+ %
+ %  The format of the SyncImage routine is:
+ %
+ %      SyncImage(image)
+ %
+ %  A description of each parameter follows:
+ %
+ %    o image: The address of a structure of type Image.
+ %
+ %
+ */
+ void SyncImage(image)
+ Image
+   *image;
+ {
+   register int
+     i;
+ 
+   register RunlengthPacket
+     *p;
+ 
+   register unsigned short
+     index;
+ 
+   p=image->pixels;
+   for (i=0; i < image->packets; i++)
+   {
+     index=p->index;
+     p->red=image->colormap[index].red;
+     p->green=image->colormap[index].green;
+     p->blue=image->colormap[index].blue;
+     p++;
+   }
+ }
  
  /*
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
***************
*** 5430,5436 ****
  %
  %
  */
! Image *ZoomImage(image)
  Image
    *image;
  {
--- 5439,5445 ----
  %
  %
  */
! static Image *ZoomImage(image)
  Image
    *image;
  {
diff -r -c ImageMagick/image.h ImageMagick2.2.3/image.h
*** ImageMagick/image.h	Tue Dec 22 16:04:24 1992
--- ImageMagick2.2.3/image.h	Wed Dec 23 18:33:18 1992
***************
*** 146,159 ****
    *EnhanceImage _Declare((Image *)),
    *NoisyImage _Declare((Image *)),
    *ReadImage _Declare((char *)),
-   *ReduceImage _Declare((Image *)),
    *ReflectImage _Declare((Image *)),
!   *RollImage _Declare((Image *,unsigned int,unsigned int)),
!   *RotateImage _Declare((Image *,double,int)),
    *ScaleImage _Declare((Image *,unsigned int,unsigned int)),
    *ShearImage _Declare((Image *,double,double,unsigned int)),
!   *StereoImage _Declare((Image *,Image *)),
!   *ZoomImage _Declare((Image *));
  
  extern int
    ReadDataBlock _Declare((char *,FILE *));
--- 146,157 ----
    *EnhanceImage _Declare((Image *)),
    *NoisyImage _Declare((Image *)),
    *ReadImage _Declare((char *)),
    *ReflectImage _Declare((Image *)),
!   *RollImage _Declare((Image *,int,int)),
!   *RotateImage _Declare((Image *,double,unsigned int)),
    *ScaleImage _Declare((Image *,unsigned int,unsigned int)),
    *ShearImage _Declare((Image *,double,double,unsigned int)),
!   *StereoImage _Declare((Image *,Image *));
  
  extern int
    ReadDataBlock _Declare((char *,FILE *));
***************
*** 186,190 ****
--- 184,189 ----
      unsigned int,unsigned int,unsigned int,unsigned int)),
    RGBTransformImage _Declare((Image *,unsigned int)),
    SortColormapByIntensity _Declare((Image *)),
+   SyncImage _Declare((Image *)),
    TransformImage _Declare((Image **,char *,char *,char *)),
    TransformRGBImage _Declare((Image *,unsigned int));
Common subdirectories: ImageMagick/images and ImageMagick2.2.3/images
diff -r -c ImageMagick/import.c ImageMagick2.2.3/import.c
*** ImageMagick/import.c	Tue Dec 22 16:04:24 1992
--- ImageMagick2.2.3/import.c	Wed Dec 23 18:10:03 1992
***************
*** 433,439 ****
    /*
      Read image from X server.
    */
!   if (resource_info.delay > 0)
      (void) sleep(resource_info.delay);
    start_time=time((time_t *) 0);
    image=ReadXImage(target_window,server_name,frame,screen,borders);
--- 433,439 ----
    /*
      Read image from X server.
    */
!   if (resource_info.delay != 0)
      (void) sleep(resource_info.delay);
    start_time=time((time_t *) 0);
    image=ReadXImage(target_window,server_name,frame,screen,borders);
***************
*** 459,465 ****
          (void) fprintf(stderr," DirectClass ");
        else
          (void) fprintf(stderr," PseudoClass ");
!       (void) fprintf(stderr,"%dc %s %ds\n",image->colors,image->magick,
          time((time_t *) 0)-start_time+1);
      }
    DestroyImage(image);
--- 459,465 ----
          (void) fprintf(stderr," DirectClass ");
        else
          (void) fprintf(stderr," PseudoClass ");
!       (void) fprintf(stderr,"%dc %s %lds\n",image->colors,image->magick,
          time((time_t *) 0)-start_time+1);
      }
    DestroyImage(image);
diff -r -c ImageMagick/montage.c ImageMagick2.2.3/montage.c
*** ImageMagick/montage.c	Tue Dec 22 16:04:25 1992
--- ImageMagick2.2.3/montage.c	Wed Dec 23 18:10:04 1992
***************
*** 249,255 ****
      tile_border_height,
      tile_border_width,
      x,
!     y;
  
    register char
      *q;
--- 249,257 ----
      tile_border_height,
      tile_border_width,
      x,
!     x_offset,
!     y,
!     y_offset;
  
    register char
      *q;
***************
*** 266,274 ****
      status,
      tile,
      tile_height,
!     tile_width,
!     x_offset,
!     y_offset;
  
    XAnnotateInfo
      annotate_info;
--- 268,274 ----
      status,
      tile,
      tile_height,
!     tile_width;
  
    XAnnotateInfo
      annotate_info;
***************
*** 488,494 ****
      status=UnpackImage(image);
      if (status == False)
        Error("unable to unpack image",(char *) NULL);
!     if (border_width > 0)
        {
          Image
            *bordered_image;
--- 488,494 ----
      status=UnpackImage(image);
      if (status == False)
        Error("unable to unpack image",(char *) NULL);
!     if (border_width != 0)
        {
          Image
            *bordered_image;
***************
*** 1396,1408 ****
      QuantizeImage(montage_image,256,8,resource_info.dither,GRAYColorspace,True);
    if (resource_info.monochrome)
      QuantizeImage(montage_image,2,8,resource_info.dither,GRAYColorspace,True);
!   if (resource_info.number_colors > 0)
!     QuantizeImage(montage_image,resource_info.number_colors,
!       resource_info.tree_depth,resource_info.dither,resource_info.colorspace,
!       True);
    if (compression != UndefinedCompression)
      montage_image->compression=compression;
!   strcpy(montage_image->filename,write_filename);
    (void) WriteAlienImage(montage_image);
    if (verbose)
      {
--- 1396,1411 ----
      QuantizeImage(montage_image,256,8,resource_info.dither,GRAYColorspace,True);
    if (resource_info.monochrome)
      QuantizeImage(montage_image,2,8,resource_info.dither,GRAYColorspace,True);
!   if (resource_info.number_colors != 0)
!     {
!       QuantizeImage(montage_image,resource_info.number_colors,
!         resource_info.tree_depth,resource_info.dither,resource_info.colorspace,
!         True);
!       SyncImage(montage_image);
!     }
    if (compression != UndefinedCompression)
      montage_image->compression=compression;
!   (void) strcpy(montage_image->filename,write_filename);
    (void) WriteAlienImage(montage_image);
    if (verbose)
      {
diff -r -c ImageMagick/quantize.c ImageMagick2.2.3/quantize.c
*** ImageMagick/quantize.c	Tue Dec 22 16:06:18 1992
--- ImageMagick2.2.3/quantize.c	Wed Dec 23 18:10:04 1992
***************
*** 430,436 ****
          cube.color.red=p->red;
          cube.color.green=p->green;
          cube.color.blue=p->blue;
!         cube.distance=(~0);
          ClosestColor(node->parent);
          p->index=cube.color_number;
          p++;
--- 430,436 ----
          cube.color.red=p->red;
          cube.color.green=p->green;
          cube.color.blue=p->blue;
!         cube.distance=(unsigned long int) (~0);
          ClosestColor(node->parent);
          p->index=cube.color_number;
          p++;
***************
*** 900,906 ****
            cube.color.red=red;
            cube.color.green=green;
            cube.color.blue=blue;
!           cube.distance=(~0);
            ClosestColor(node->parent);
            cache[i]=cube.color_number;
          }
--- 900,906 ----
            cube.color.red=red;
            cube.color.green=green;
            cube.color.blue=blue;
!           cube.distance=(unsigned long int) (~0);
            ClosestColor(node->parent);
            cache[i]=cube.color_number;
          }
***************
*** 1020,1026 ****
    /*
      Initialize the shift values.
    */
!   for (max_shift=0; number_pixels > 0; max_shift++)
      number_pixels<<=1;
    for (level=0; level < cube.depth; level++)
    {
--- 1020,1026 ----
    /*
      Initialize the shift values.
    */
!   for (max_shift=0; number_pixels != 0; max_shift++)
      number_pixels<<=1;
    for (level=0; level < cube.depth; level++)
    {
***************
*** 1044,1050 ****
        exit(1);
      }
    cube.root->parent=cube.root;
!   cube.root->number_colors=(~0);
    cube.colors=0;
  }
  
--- 1044,1050 ----
        exit(1);
      }
    cube.root->parent=cube.root;
!   cube.root->number_colors=(unsigned long int) (~0);
    cube.colors=0;
  }
  
***************
*** 1552,1558 ****
      RGBTransformImage(image,colorspace);
    Classification(image);
    if (!optimal)
!     dither|=cube.colors > (1 << (cube.depth-1));
    Reduction(number_colors);
    Assignment(image,dither,optimal);
    if (colorspace != RGBColorspace)
--- 1552,1558 ----
      RGBTransformImage(image,colorspace);
    Classification(image);
    if (!optimal)
!     dither|=(cube.colors > (1 << (cube.depth-1)));
    Reduction(number_colors);
    Assignment(image,dither,optimal);
    if (colorspace != RGBColorspace)
***************
*** 1689,1695 ****
        Classification(images[i]);
    }
    if (!optimal)
!     dither|=cube.colors > (1 << (cube.depth-1));
    Reduction(number_colors);
    for (i=0; i < number_images; i++)
    {
--- 1689,1695 ----
        Classification(images[i]);
    }
    if (!optimal)
!     dither|=(cube.colors > (1 << (cube.depth-1)));
    Reduction(number_colors);
    for (i=0; i < number_images; i++)
    {
Only in ImageMagick2.2.3: rotate.c
Common subdirectories: ImageMagick/scenes and ImageMagick2.2.3/scenes
diff -r -c ImageMagick/shear.c ImageMagick2.2.3/shear.c
*** ImageMagick/shear.c	Tue Dec 22 16:04:26 1992
--- ImageMagick2.2.3/shear.c	Wed Dec 23 21:12:31 1992
***************
*** 940,946 ****
  double
    degrees;
  
! int
    clip;
  {
    ColorPacket
--- 940,946 ----
  double
    degrees;
  
! unsigned int
    clip;
  {
    ColorPacket
***************
*** 1038,1044 ****
    background.red=image->pixels[0].red;
    background.green=image->pixels[0].green;
    background.blue=image->pixels[0].blue;
!   rotated_image=BorderImage(integral_image,x_offset,y_offset+1,background);
    DestroyImage(integral_image);
    if (rotated_image == (Image *) NULL)
      {
--- 1038,1045 ----
    background.red=image->pixels[0].red;
    background.green=image->pixels[0].green;
    background.blue=image->pixels[0].blue;
!   rotated_image=BorderImage(integral_image,(unsigned int) x_offset,
!     (unsigned int) y_offset+1,background);
    DestroyImage(integral_image);
    if (rotated_image == (Image *) NULL)
      {
***************
*** 1187,1193 ****
    background.red=image->pixels[0].red;
    background.green=image->pixels[0].green;
    background.blue=image->pixels[0].blue;
!   sheared_image=BorderImage(image,x_offset,y_offset+1,background);
    if (sheared_image == (Image *) NULL)
      {
        Warning("unable to rotate image","memory allocation failed");
--- 1188,1195 ----
    background.red=image->pixels[0].red;
    background.green=image->pixels[0].green;
    background.blue=image->pixels[0].blue;
!   sheared_image=BorderImage(image,(unsigned int) x_offset,
!     (unsigned int) y_offset+1,background);
    if (sheared_image == (Image *) NULL)
      {
        Warning("unable to rotate image","memory allocation failed");
diff -r -c ImageMagick/signature.c ImageMagick2.2.3/signature.c
*** ImageMagick/signature.c	Tue Dec 22 16:04:27 1992
--- ImageMagick2.2.3/signature.c	Wed Dec 23 18:10:04 1992
***************
*** 244,265 ****
    static unsigned long int
      additive_constant[64]=  /* 4294967296*abs(sin(i)), i in radians */
      {
!       3614090360L, 3905402710L,  606105819L, 3250441966L,
!       4118548399L, 1200080426L, 2821735955L, 4249261313L,
!       1770035416L, 2336552879L, 4294925233L, 2304563134L,
!       1804603682L, 4254626195L, 2792965006L, 1236535329L,
!       4129170786L, 3225465664L,  643717713L, 3921069994L,
!       3593408605L,   38016083L, 3634488961L, 3889429448L,
!        568446438L, 3275163606L, 4107603335L, 1163531501L,
!       2850285829L, 4243563512L, 1735328473L, 2368359562L,
!       4294588738L, 2272392833L, 1839030562L, 4259657740L,
!       2763975236L, 1272893353L, 4139469664L, 3200236656L,
!        681279174L, 3936430074L, 3572445317L,   76029189L,
!       3654602809L, 3873151461L,  530742520L, 3299628645L,
!       4096336452L, 1126891415L, 2878612391L, 4237533241L,
!       1700485571L, 2399980690L, 4293915773L, 2240044497L,
!       1873313359L, 4264355552L, 2734768916L, 1309151649L,
!       4149444226L, 3173756917L,  718787259L, 3951481745L
      };
  
    register int
--- 244,262 ----
    static unsigned long int
      additive_constant[64]=  /* 4294967296*abs(sin(i)), i in radians */
      {
!       0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee, 0xf57c0faf,
!       0x4787c62a, 0xa8304613, 0xfd469501, 0x698098d8, 0x8b44f7af,
!       0xffff5bb1, 0x895cd7be, 0x6b901122, 0xfd987193, 0xa679438e,
!       0x49b40821, 0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa,
!       0xd62f105d, 0x2441453,  0xd8a1e681, 0xe7d3fbc8, 0x21e1cde6,
!       0xc33707d6, 0xf4d50d87, 0x455a14ed, 0xa9e3e905, 0xfcefa3f8,
!       0x676f02d9, 0x8d2a4c8a, 0xfffa3942, 0x8771f681, 0x6d9d6122,
!       0xfde5380c, 0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70,
!       0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x4881d05,  0xd9d4d039,
!       0xe6db99e5, 0x1fa27cf8, 0xc4ac5665, 0xf4292244, 0x432aff97,
!       0xab9423a7, 0xfc93a039, 0x655b59c3, 0x8f0ccc92, 0xffeff47d,
!       0x85845dd1, 0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1,
!       0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391,
      };
  
    register int
Common subdirectories: ImageMagick/utilities and ImageMagick2.2.3/utilities
Common subdirectories: ImageMagick/xtp and ImageMagick2.2.3/xtp
diff -r -c ImageMagick/utilities/MIFFtoSTEREO.c ImageMagick2.2.3/utilities/MIFFtoSTEREO.c
*** ImageMagick/utilities/MIFFtoSTEREO.c	Tue Dec 22 16:05:22 1992
--- ImageMagick2.2.3/utilities/MIFFtoSTEREO.c	Wed Dec 23 18:10:10 1992
***************
*** 200,206 ****
      (void) fprintf(stderr," DirectClass ");
    else
      (void) fprintf(stderr," PseudoClass ");
!   (void) fprintf(stderr,"%dc %s %ds\n",stereo_image->colors,
      stereo_image->magick,time((time_t *) 0)-start_time+1);
    return(!status);
  }
--- 200,206 ----
      (void) fprintf(stderr," DirectClass ");
    else
      (void) fprintf(stderr," PseudoClass ");
!   (void) fprintf(stderr,"%dc %s %lds\n",stereo_image->colors,
      stereo_image->magick,time((time_t *) 0)-start_time+1);
    return(!status);
  }
diff -r -c ImageMagick/utilities/convert.c ImageMagick2.2.3/utilities/convert.c
*** ImageMagick/utilities/convert.c	Tue Dec 22 16:05:23 1992
--- ImageMagick2.2.3/utilities/convert.c	Wed Dec 23 18:10:10 1992
***************
*** 203,209 ****
  char
    *argv[];
  {
! #define NotInitialized  (~0)
  
    AlienInfo
      alien_info;
--- 203,209 ----
  char
    *argv[];
  {
! #define NotInitialized  (unsigned int) (~0)
  
    AlienInfo
      alien_info;
***************
*** 212,217 ****
--- 212,221 ----
      *filename,
      *option;
  
+   double
+     normalized_maximum_error,
+     normalized_mean_error;
+ 
    Image
      *image,
      *next_image;
***************
*** 229,241 ****
      colorspace,
      compression,
      dither,
      number_colors,
      quality,
      scene,
-     total_colors,
      tree_depth,
      verbose;
  
    /*
      Initialize program variables.
    */
--- 233,248 ----
      colorspace,
      compression,
      dither,
+     mean_error_per_pixel,
      number_colors,
      quality,
      scene,
      tree_depth,
      verbose;
  
+   unsigned long int
+     total_colors;
+ 
    /*
      Initialize program variables.
    */
***************
*** 453,483 ****
    */
    do
    {
      if (alpha != NotInitialized)
        image->alpha=alpha;
      if (compression != UndefinedCompression)
        image->compression=compression;
!     if (quality > 0)
        image->quality=quality;
!     if (scene > 0)
        image->scene=scene;
      (void) strcpy(image->filename,argv[i]);
      if (image->last != (Image *) NULL)
        (void) sprintf(image->filename,"%s.%u\0",argv[i],image->scene);
-     if (verbose)
-       {
-         /*
-           Initialize image error attributes.
-         */
-         if (image->class == DirectClass)
-           image->colors=NumberColors(image,(FILE *) NULL);
-         total_colors=image->colors;
-       }
      if (colorspace == GRAYColorspace)
        QuantizeImage(image,256,8,dither,GRAYColorspace,True);
!     if (number_colors > 0)
        if ((image->class == DirectClass) || (image->colors > number_colors))
!         QuantizeImage(image,number_colors,tree_depth,dither,colorspace,True);
      status=WriteAlienImage(image);
      if (verbose)
        {
--- 460,497 ----
    */
    do
    {
+     total_colors=0;
      if (alpha != NotInitialized)
        image->alpha=alpha;
      if (compression != UndefinedCompression)
        image->compression=compression;
!     if (quality != 0)
        image->quality=quality;
!     if (scene != 0)
        image->scene=scene;
      (void) strcpy(image->filename,argv[i]);
      if (image->last != (Image *) NULL)
        (void) sprintf(image->filename,"%s.%u\0",argv[i],image->scene);
      if (colorspace == GRAYColorspace)
        QuantizeImage(image,256,8,dither,GRAYColorspace,True);
!     if (number_colors != 0)
        if ((image->class == DirectClass) || (image->colors > number_colors))
!         {
!           /*
!             Reduce the number of colors in the image.
!           */
!           QuantizeImage(image,number_colors,tree_depth,dither,colorspace,True);
!           if (verbose)
!             {
!               /*
!                 Measure quantization error.
!               */
!               QuantizationError(image,&mean_error_per_pixel,
!                 &normalized_mean_error,&normalized_maximum_error);
!               total_colors=NumberColors(image,(FILE *) NULL);
!             }
!           SyncImage(image);
!         }
      status=WriteAlienImage(image);
      if (verbose)
        {
***************
*** 490,512 ****
            (void) fprintf(stderr," DirectClass ");
          else
            (void) fprintf(stderr," PseudoClass ");
!         if (total_colors != image->colors)
!           (void) fprintf(stderr,"%u=>",total_colors);
!         (void) fprintf(stderr,"%uc",image->colors);
!         if (number_colors > 0)
            {
!             double
!               normalized_maximum_error,
!               normalized_mean_error;
! 
!             unsigned int
!               mean_error_per_pixel;
! 
!             /*
!               Measure quantization error.
!             */
!             QuantizationError(image,&mean_error_per_pixel,
!               &normalized_mean_error,&normalized_maximum_error);
              (void) fprintf(stderr," %u/%.6f/%.6fe",mean_error_per_pixel,
                normalized_mean_error,normalized_maximum_error);
            }
--- 504,514 ----
            (void) fprintf(stderr," DirectClass ");
          else
            (void) fprintf(stderr," PseudoClass ");
!         if (total_colors == 0)
!           (void) fprintf(stderr,"%uc",image->colors);
!         else
            {
!             (void) fprintf(stderr,"%lu=>%uc",total_colors,image->colors);
              (void) fprintf(stderr," %u/%.6f/%.6fe",mean_error_per_pixel,
                normalized_mean_error,normalized_maximum_error);
            }
diff -r -c ImageMagick/utilities/mogrify.c ImageMagick2.2.3/utilities/mogrify.c
*** ImageMagick/utilities/mogrify.c	Tue Dec 22 16:05:24 1992
--- ImageMagick2.2.3/utilities/mogrify.c	Wed Dec 23 18:10:10 1992
***************
*** 629,634 ****
--- 629,638 ----
        }
      else
        {
+         double
+           normalized_maximum_error,
+           normalized_mean_error;
+ 
          Image
            *image,
            info_image,
***************
*** 637,642 ****
--- 641,649 ----
          time_t
            start_time;
  
+         unsigned int
+           mean_error_per_pixel;
+ 
          unsigned long
            total_colors;
  
***************
*** 656,661 ****
--- 663,669 ----
            info_image=(*image);
            if (scene > 0)
              image->scene=scene;
+           total_colors=0;
            /*
              Transform image as defined by the clip, image and scale geometries.
            */
***************
*** 796,810 ****
              InverseImage(image);
            if (normalize)
              NormalizeImage(image);
-           if (verbose)
-             {
-               /*
-                 Initialize image error attributes.
-               */
-               if (image->class == DirectClass)
-                 image->colors=NumberColors(image,(FILE *) NULL);
-               total_colors=image->colors;
-             }
            if (colorspace == GRAYColorspace)
              QuantizeImage(image,256,8,dither,GRAYColorspace,True);
            if (monochrome)
--- 804,809 ----
***************
*** 812,819 ****
            if (number_colors > 0)
              if ((image->class == DirectClass) ||
                  (image->colors > number_colors))
!               QuantizeImage(image,number_colors,tree_depth,dither,colorspace,
!                 True);
            if (verbose)
              {
                /*
--- 811,833 ----
            if (number_colors > 0)
              if ((image->class == DirectClass) ||
                  (image->colors > number_colors))
!               {
!                 /*
!                   Reduce the number of colors in the image.
!                 */
!                 QuantizeImage(image,number_colors,tree_depth,dither,colorspace,
!                   True);
!                 if (verbose)
!                   {
!                     /*
!                       Measure quantization error.
!                     */
!                     QuantizationError(image,&mean_error_per_pixel,
!                       &normalized_mean_error,&normalized_maximum_error);
!                     total_colors=NumberColors(image,(FILE *) NULL);
!                   }
!                 SyncImage(image);
!               }
            if (verbose)
              {
                /*
***************
*** 831,853 ****
                  (void) fprintf(stderr," DirectClass ");
                else
                  (void) fprintf(stderr," PseudoClass ");
!               if (total_colors != image->colors)
!                 (void) fprintf(stderr,"%lu=>",total_colors);
!               (void) fprintf(stderr,"%uc",image->colors);
!               if ((number_colors > 0) || monochrome)
                  {
!                   double
!                     normalized_maximum_error,
!                     normalized_mean_error;
! 
!                   unsigned int
!                     mean_error_per_pixel;
! 
!                   /*
!                     Measure quantization error.
!                   */
!                   QuantizationError(image,&mean_error_per_pixel,
!                     &normalized_mean_error,&normalized_maximum_error);
                    (void) fprintf(stderr," %u/%.6f/%.6fe",mean_error_per_pixel,
                      normalized_mean_error,normalized_maximum_error);
                  }
--- 845,855 ----
                  (void) fprintf(stderr," DirectClass ");
                else
                  (void) fprintf(stderr," PseudoClass ");
!               if (total_colors == 0)
!                 (void) fprintf(stderr,"%uc",image->colors);
!               else
                  {
!                   (void) fprintf(stderr,"%lu=>%uc",total_colors,image->colors);
                    (void) fprintf(stderr," %u/%.6f/%.6fe",mean_error_per_pixel,
                      normalized_mean_error,normalized_maximum_error);
                  }
diff -r -c ImageMagick/xtp/xtp.c ImageMagick2.2.3/xtp/xtp.c
*** ImageMagick/xtp/xtp.c	Tue Dec 22 16:05:32 1992
--- ImageMagick2.2.3/xtp/xtp.c	Wed Dec 23 21:12:13 1992
***************
*** 313,319 ****
    (void) tcgetattr(STDIN_FILENO,&attributes);
    attributes.c_lflag&=(~ECHO);
    (void) tcsetattr(STDIN_FILENO,TCSANOW,&attributes);
!   gets(password);
    attributes.c_lflag|=ECHO;
    (void) tcsetattr(STDIN_FILENO,TCSANOW,&attributes);
    (void) fprintf(stdout,"\n");
--- 313,319 ----
    (void) tcgetattr(STDIN_FILENO,&attributes);
    attributes.c_lflag&=(~ECHO);
    (void) tcsetattr(STDIN_FILENO,TCSANOW,&attributes);
!   (void) gets(password);
    attributes.c_lflag|=ECHO;
    (void) tcsetattr(STDIN_FILENO,TCSANOW,&attributes);
    (void) fprintf(stdout,"\n");
-- 
cristy@dupont.com
Technical Details
Message-ID: <cristy.725168085@eplrx7.es.dupont.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!jvnc.net!darwin.sura.net!udel!louie!eplrx7!eplrx7.es.dupont.com!cristy

Show Full Headers
Complete Article Headers
Newsgroups: comp.sources.bugs
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!jvnc.net!darwin.sura.net!udel!louie!eplrx7!eplrx7.es.dupont.com!cristy
From: cristy@eplrx7.es.duPont.com (Cristy)
Subject: ImageMagick 2.2 - patch #3
Message-ID: <cristy.725168085@eplrx7.es.dupont.com>
Summary: X11 image processing and display utilities
Keywords: UNIX VMS X11 SGI DEC Cray Sun Vax
Organization: DuPont Engineering Physics Laboratory
Date: Thu, 24 Dec 1992 03:34:45 GMT
Lines: 2099