home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume34 / imagemagick / patch03 < prev    next >
Encoding:
Text File  |  1992-12-27  |  62.1 KB  |  2,114 lines

  1. Newsgroups: comp.sources.misc
  2. From: cristy@eplrx7.es.duPont.com (John Cristy)
  3. Subject: v34i089: imagemagick - X11 image processing and display v2.2, Patch03
  4. Message-ID: <1992Dec27.234100.3011@sparky.imd.sterling.com>
  5. X-Md4-Signature: 390278494462d340bd35ec240984b102
  6. Date: Sun, 27 Dec 1992 23:41:00 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: cristy@eplrx7.es.duPont.com (John Cristy)
  10. Posting-number: Volume 34, Issue 89
  11. Archive-name: imagemagick/patch03
  12. Environment: UNIX, VMS, X11, SGI, DEC, Cray, Sun, Vax
  13. Patch-To: imagemagick: Volume 34, Issue 28-54
  14.  
  15.                     ImageMagick 2.2 Patch #3
  16.  
  17. To apply this patch:
  18.  
  19. cd to the top of the source tree (to the directory containing the
  20. "ImageMagick" subdirectories) and do:
  21.  
  22.   patch -p < ThisFile
  23.  
  24. Prereq - ImageMagick 2.2.2 (posted from comp.sources.misc, Volume 34,
  25. Issue 28 + Patch 1 & 2).
  26.  
  27. Alternatively get the entire distribution as contrib/ImageMagick.tar.Z
  28. on export.lcs.mit.edu.
  29.  
  30.  
  31. diff -r -c ImageMagick/ChangeLog ImageMagick2.2.3/ChangeLog
  32. *** ImageMagick/ChangeLog    Tue Dec 22 16:07:20 1992
  33. --- ImageMagick2.2.3/ChangeLog    Wed Dec 23 18:10:05 1992
  34. ***************
  35. *** 1,3 ****
  36. --- 1,12 ----
  37. + ImageMagick 2.2.3
  38. +   o Non-color reduced images were being written even though the color
  39. +     reduction option was specified (-colors).  This affected images written
  40. +     as AVS, CMYK, and RGB.
  41. +   o Modified various sources to reduce lint warnings.
  42.   ImageMagick 2.2.2
  43.   
  44.     o Dithering did not work properly on the Cray (due to right shift problem).
  45. diff -r -c ImageMagick/X.c ImageMagick2.2.3/X.c
  46. *** ImageMagick/X.c    Tue Dec 22 16:06:18 1992
  47. --- ImageMagick2.2.3/X.c    Wed Dec 23 18:10:01 1992
  48. ***************
  49. *** 73,81 ****
  50. --- 73,89 ----
  51.   int
  52.     Latin1Compare _Declare((char *,char *));
  53.   
  54. + static unsigned int
  55. +   XReadColormap _Declare((Display *,XWindowAttributes *,XColor **));
  56.   static void
  57.     XMakeImageLSBFirst _Declare((XWindowInfo *,Image *, XImage *)),
  58.     XMakeImageMSBFirst _Declare((XWindowInfo *,Image *, XImage *));
  59. + static Window
  60. +   XClientWindow _Declare((Display *,Window)),
  61. +   XSelectWindow _Declare((Display *,XRectangle *)),
  62. +   XWindowByProperty _Declare((Display *,Window,Atom));
  63.   
  64.   /*
  65.   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  66. ***************
  67. *** 221,227 ****
  68.   %
  69.   %
  70.   */
  71. ! void Latin1Upper(string)
  72.   char
  73.     *string;
  74.   {
  75. --- 229,235 ----
  76.   %
  77.   %
  78.   */
  79. ! static void Latin1Upper(string)
  80.   char
  81.     *string;
  82.   {
  83. ***************
  84. *** 1296,1302 ****
  85.       Initialize graphics info.
  86.     */
  87.     graphic_context_value.background=0;
  88. !   graphic_context_value.foreground=(~0);
  89.     graphic_context_value.font=annotate_info->font_info->fid;
  90.     graphic_context=XCreateGC(display,window->id,GCBackground | GCFont |
  91.       GCForeground,&graphic_context_value);
  92. --- 1304,1310 ----
  93.       Initialize graphics info.
  94.     */
  95.     graphic_context_value.background=0;
  96. !   graphic_context_value.foreground=(unsigned long) (~0);
  97.     graphic_context_value.font=annotate_info->font_info->fid;
  98.     graphic_context=XCreateGC(display,window->id,GCBackground | GCFont |
  99.       GCForeground,&graphic_context_value);
  100. ***************
  101. *** 1711,1717 ****
  102.       Find closest representation for the requested RGB color.
  103.     */
  104.     color->pixel=0;
  105. !   min_distance=(~0);
  106.     for (i=0; i < number_colors; i++)
  107.     {
  108.       red_distance=(colors[i].red >> 8)-(color->red >> 8);
  109. --- 1719,1725 ----
  110.       Find closest representation for the requested RGB color.
  111.     */
  112.     color->pixel=0;
  113. !   min_distance=(unsigned long) (~0);
  114.     for (i=0; i < number_colors; i++)
  115.     {
  116.       red_distance=(colors[i].red >> 8)-(color->red >> 8);
  117. ***************
  118. *** 2019,2025 ****
  119.   %
  120.   %
  121.   */
  122. ! Window XClientWindow(display,target_window)
  123.   Display
  124.     *display;
  125.   
  126. --- 2027,2033 ----
  127.   %
  128.   %
  129.   */
  130. ! static Window XClientWindow(display,target_window)
  131.   Display
  132.     *display;
  133.   
  134. ***************
  135. *** 2993,2999 ****
  136.                 /*
  137.                   Advance to the next scanline.
  138.                 */
  139. !               if (bit > 0)
  140.                   *q=byte >> (8-bit);
  141.                 q+=scanline_pad;
  142.                 bit=0;
  143. --- 3001,3007 ----
  144.                 /*
  145.                   Advance to the next scanline.
  146.                 */
  147. !               if (bit != 0)
  148.                   *q=byte >> (8-bit);
  149.                 q+=scanline_pad;
  150.                 bit=0;
  151. ***************
  152. *** 3484,3490 ****
  153.                 /*
  154.                   Advance to the next scanline.
  155.                 */
  156. !               if (bit > 0)
  157.                   *q=byte << (8-bit);
  158.                 q+=scanline_pad;
  159.                 bit=0;
  160. --- 3492,3498 ----
  161.                 /*
  162.                   Advance to the next scanline.
  163.                 */
  164. !               if (bit != 0)
  165.                   *q=byte << (8-bit);
  166.                 q+=scanline_pad;
  167.                 bit=0;
  168. ***************
  169. *** 5357,5363 ****
  170.           status=XGetWindowProperty(display,XRootWindow(display,0),XA_CUT_BUFFER0,
  171.             0L,2047L,False,XA_STRING,&type,&format,&length,&after,&data);
  172.           if ((status != Success) || (type != XA_STRING) || (format == 32) ||
  173. !             (length <= 0))
  174.             break;
  175.           /*
  176.             Append cut buffer to reply.
  177. --- 5365,5371 ----
  178.           status=XGetWindowProperty(display,XRootWindow(display,0),XA_CUT_BUFFER0,
  179.             0L,2047L,False,XA_STRING,&type,&format,&length,&after,&data);
  180.           if ((status != Success) || (type != XA_STRING) || (format == 32) ||
  181. !             (length == 0))
  182.             break;
  183.           /*
  184.             Append cut buffer to reply.
  185. ***************
  186. *** 5527,5533 ****
  187.   %
  188.   %
  189.   */
  190. ! unsigned int XReadColormap(display,window_attributes,colors)
  191.   Display
  192.     *display;
  193.   
  194. --- 5535,5541 ----
  195.   %
  196.   %
  197.   */
  198. ! static unsigned int XReadColormap(display,window_attributes,colors)
  199.   Display
  200.     *display;
  201.   
  202. ***************
  203. *** 5727,5733 ****
  204.   %
  205.   %
  206.   */
  207. ! Window XSelectWindow(display,clip_info)
  208.   Display
  209.     *display;
  210.   
  211. --- 5735,5741 ----
  212.   %
  213.   %
  214.   */
  215. ! static Window XSelectWindow(display,clip_info)
  216.   Display
  217.     *display;
  218.   
  219. ***************
  220. *** 6102,6108 ****
  221.   %
  222.   %
  223.   */
  224. ! Window XWindowByProperty(display,window,property)
  225.   Display
  226.     *display;
  227.   
  228. --- 6110,6116 ----
  229.   %
  230.   %
  231.   */
  232. ! static Window XWindowByProperty(display,window,property)
  233.   Display
  234.     *display;
  235.   
  236. diff -r -c ImageMagick/X.h ImageMagick2.2.3/X.h
  237. *** ImageMagick/X.h    Tue Dec 22 16:04:15 1992
  238. --- ImageMagick2.2.3/X.h    Wed Dec 23 18:10:04 1992
  239. ***************
  240. *** 266,279 ****
  241.       unsigned int,unsigned int)),
  242.     XMakePixmap _Declare((Display *,XResourceInfo *,XWindowInfo *)),
  243.     XPopupMenu _Declare((Display *,XWindowInfo *,int,int,char *,char **,
  244. !     unsigned int,char *)),
  245. !   XReadColormap _Declare((Display *,XWindowAttributes *,XColor **));
  246.   
  247.   extern XVisualInfo 
  248.     *XBestVisualInfo _Declare((Display *,char *,char *,XStandardColormap *));
  249.   
  250.   extern void 
  251. -   Latin1Upper _Declare((char *)),
  252.     XBestIconSize _Declare((Display *,XWindowInfo *,Image *)),
  253.     XFreeStandardColormap _Declare((Display *,XVisualInfo *,XPixelInfo *,
  254.       XStandardColormap *)),
  255. --- 266,277 ----
  256.       unsigned int,unsigned int)),
  257.     XMakePixmap _Declare((Display *,XResourceInfo *,XWindowInfo *)),
  258.     XPopupMenu _Declare((Display *,XWindowInfo *,int,int,char *,char **,
  259. !     unsigned int,char *));
  260.   
  261.   extern XVisualInfo 
  262.     *XBestVisualInfo _Declare((Display *,char *,char *,XStandardColormap *));
  263.   
  264.   extern void 
  265.     XBestIconSize _Declare((Display *,XWindowInfo *,Image *)),
  266.     XFreeStandardColormap _Declare((Display *,XVisualInfo *,XPixelInfo *,
  267.       XStandardColormap *)),
  268. ***************
  269. *** 291,299 ****
  270.     XRefreshWindow _Declare((Display *,XWindowInfo *,XEvent *));
  271.   
  272.   extern Window 
  273. -   XClientWindow _Declare((Display *,Window)),
  274. -   XWindowByProperty _Declare((Display *,Window,Atom)),
  275. -   XSelectWindow _Declare((Display *,XRectangle *)),
  276.     XWindowByID _Declare((Display *,Window,unsigned long)),
  277.     XWindowByName _Declare((Display *,Window,char *));
  278.   
  279. --- 289,294 ----
  280. diff -r -c ImageMagick/XtoPS.c ImageMagick2.2.3/XtoPS.c
  281. *** ImageMagick/XtoPS.c    Tue Dec 22 16:04:16 1992
  282. --- ImageMagick2.2.3/XtoPS.c    Wed Dec 23 18:10:01 1992
  283. ***************
  284. *** 428,434 ****
  285.     /*
  286.       Read image from X server.
  287.     */
  288. !   if (resource_info.delay > 0)
  289.       (void) sleep(resource_info.delay);
  290.     start_time=time((time_t *) 0);
  291.     image=ReadXImage(target_window,server_name,frame,screen,borders);
  292. --- 428,434 ----
  293.     /*
  294.       Read image from X server.
  295.     */
  296. !   if (resource_info.delay != 0)
  297.       (void) sleep(resource_info.delay);
  298.     start_time=time((time_t *) 0);
  299.     image=ReadXImage(target_window,server_name,frame,screen,borders);
  300. ***************
  301. *** 469,475 ****
  302.           (void) fprintf(stderr," DirectClass ");
  303.         else
  304.           (void) fprintf(stderr," PseudoClass ");
  305. !       (void) fprintf(stderr,"%uc %s %ds\n",image->colors,image->magick,
  306.           time((time_t *) 0)-start_time+1);
  307.       }
  308.     DestroyImage(image);
  309. --- 469,475 ----
  310.           (void) fprintf(stderr," DirectClass ");
  311.         else
  312.           (void) fprintf(stderr," PseudoClass ");
  313. !       (void) fprintf(stderr,"%uc %s %lds\n",image->colors,image->magick,
  314.           time((time_t *) 0)-start_time+1);
  315.       }
  316.     DestroyImage(image);
  317. diff -r -c ImageMagick/alien.c ImageMagick2.2.3/alien.c
  318. *** ImageMagick/alien.c    Tue Dec 22 16:04:18 1992
  319. --- ImageMagick2.2.3/alien.c    Wed Dec 23 18:10:02 1992
  320. ***************
  321. *** 665,671 ****
  322.       /*
  323.         Read image attributes.
  324.       */
  325. !     if (image_count > 0)
  326.         {
  327.           /*
  328.             Allocate image structure.
  329. --- 665,671 ----
  330.       /*
  331.         Read image attributes.
  332.       */
  333. !     if (image_count != 0)
  334.         {
  335.           /*
  336.             Allocate image structure.
  337. ***************
  338. *** 2264,2270 ****
  339.           if ((number_planes % 2) == 0)
  340.             (void) fgetc(image->file);
  341.         }
  342. !     if (number_colormaps > 0)
  343.         {
  344.           /*
  345.             Read image colormaps.
  346. --- 2264,2270 ----
  347.           if ((number_planes % 2) == 0)
  348.             (void) fgetc(image->file);
  349.         }
  350. !     if (number_colormaps != 0)
  351.         {
  352.           /*
  353.             Read image colormaps.
  354. ***************
  355. *** 2457,2463 ****
  356.         }
  357.         opcode=fgetc(image->file);
  358.       }
  359. !     if (number_colormaps > 0)
  360.         {
  361.           unsigned char
  362.             pixel;
  363. --- 2457,2463 ----
  364.         }
  365.         opcode=fgetc(image->file);
  366.       }
  367. !     if (number_colormaps != 0)
  368.         {
  369.           unsigned char
  370.             pixel;
  371. ***************
  372. *** 4094,4100 ****
  373.     /*
  374.       Read colormap.
  375.     */
  376. !   if (header.ncolors > 0)
  377.       {
  378.         colors=(XColor *) malloc((unsigned int) header.ncolors*sizeof(XColor));
  379.         if (colors == (XColor *) NULL)
  380. --- 4094,4100 ----
  381.     /*
  382.       Read colormap.
  383.     */
  384. !   if (header.ncolors != 0)
  385.       {
  386.         colors=(XColor *) malloc((unsigned int) header.ncolors*sizeof(XColor));
  387.         if (colors == (XColor *) NULL)
  388. ***************
  389. *** 4288,4294 ****
  390.       Free image and colormap.
  391.     */
  392.     (void) free((char *) window_name);
  393. !   if (header.ncolors > 0)
  394.       (void) free((char *) colors);
  395.     XDestroyImage(ximage);
  396.     CloseImage(image);
  397. --- 4288,4294 ----
  398.       Free image and colormap.
  399.     */
  400.     (void) free((char *) window_name);
  401. !   if (header.ncolors != 0)
  402.       (void) free((char *) colors);
  403.     XDestroyImage(ximage);
  404.     CloseImage(image);
  405. ***************
  406. *** 5227,5233 ****
  407.                 /*
  408.                   Advance to the next scanline.
  409.                 */
  410. !               if (bit > 0)
  411.                   *q++=byte << (8-bit);
  412.                 bit=0;
  413.                 byte=0;
  414. --- 5227,5233 ----
  415.                 /*
  416.                   Advance to the next scanline.
  417.                 */
  418. !               if (bit != 0)
  419.                   *q++=byte << (8-bit);
  420.                 bit=0;
  421.                 byte=0;
  422. ***************
  423. *** 5255,5290 ****
  424.       }
  425.       case '6':
  426.       {
  427. -       unsigned short int
  428. -         index;
  429.         /*
  430.           Convert image to a PNM image.
  431.         */
  432.         (void) fprintf(image->file,"%d\n",MaxRGB);
  433. !       if (image->class == DirectClass)
  434. !         for (i=0; i < image->packets; i++)
  435.           {
  436. !           for (j=0; j <= ((int) p->length); j++)
  437. !           {
  438. !             *q++=p->red;
  439. !             *q++=p->green;
  440. !             *q++=p->blue;
  441. !           }
  442. !           p++;
  443.           }
  444. !       else
  445. !         for (i=0; i < image->packets; i++)
  446. !         {
  447. !           for (j=0; j <= ((int) p->length); j++)
  448. !           {
  449. !             index=p->index;
  450. !             *q++=image->colormap[index].red;
  451. !             *q++=image->colormap[index].green;
  452. !             *q++=image->colormap[index].blue;
  453. !           }
  454. !           p++;
  455. !         }
  456.         break;
  457.       }
  458.     }
  459. --- 5255,5274 ----
  460.       }
  461.       case '6':
  462.       {
  463.         /*
  464.           Convert image to a PNM image.
  465.         */
  466.         (void) fprintf(image->file,"%d\n",MaxRGB);
  467. !       for (i=0; i < image->packets; i++)
  468. !       {
  469. !         for (j=0; j <= ((int) p->length); j++)
  470.           {
  471. !           *q++=p->red;
  472. !           *q++=p->green;
  473. !           *q++=p->blue;
  474.           }
  475. !         p++;
  476. !       }
  477.         break;
  478.       }
  479.     }
  480. ***************
  481. *** 5627,5633 ****
  482.                     /*
  483.                       Advance to the next scanline.
  484.                     */
  485. !                   if (bit > 0)
  486.                       *q++=byte << (8-bit);
  487.                     if (TIFFWriteScanline(file,scanline,y,0) < 0)
  488.                       break;
  489. --- 5611,5617 ----
  490.                     /*
  491.                       Advance to the next scanline.
  492.                     */
  493. !                   if (bit != 0)
  494.                       *q++=byte << (8-bit);
  495.                     if (TIFFWriteScanline(file,scanline,y,0) < 0)
  496.                       break;
  497. ***************
  498. *** 5643,5649 ****
  499.           }
  500.     (void) free((char *) scanline);
  501.     (void) TIFFFlushData(file);
  502. !   if (verbose)
  503.       TIFFPrintDirectory(file,stderr,False);
  504.     (void) TIFFClose(file);
  505.     return(True);
  506. --- 5627,5633 ----
  507.           }
  508.     (void) free((char *) scanline);
  509.     (void) TIFFFlushData(file);
  510. !   if (verbose == True)
  511.       TIFFPrintDirectory(file,stderr,False);
  512.     (void) TIFFClose(file);
  513.     return(True);
  514. ***************
  515. *** 5930,5936 ****
  516.                   /*
  517.                     Advance to the next scanline.
  518.                   */
  519. !                 if (bit > 0)
  520.                     *q++=byte << (8-bit);
  521.                   if ((((image->columns/8)+
  522.                       (image->columns % 8 ? 1 : 0)) % 2) != 0)
  523. --- 5914,5920 ----
  524.                   /*
  525.                     Advance to the next scanline.
  526.                   */
  527. !                 if (bit != 0)
  528.                     *q++=byte << (8-bit);
  529.                   if ((((image->columns/8)+
  530.                       (image->columns % 8 ? 1 : 0)) % 2) != 0)
  531. ***************
  532. *** 6065,6071 ****
  533.         x++;
  534.         if (x == image->columns)
  535.           {
  536. !           if (bit > 0)
  537.               {
  538.                 /*
  539.                   Write a bitmap byte to the image file.
  540. --- 6049,6055 ----
  541.         x++;
  542.         if (x == image->columns)
  543.           {
  544. !           if (bit != 0)
  545.               {
  546.                 /*
  547.                   Write a bitmap byte to the image file.
  548. diff -r -c ImageMagick/animate.c ImageMagick2.2.3/animate.c
  549. *** ImageMagick/animate.c    Tue Dec 22 16:04:19 1992
  550. --- ImageMagick2.2.3/animate.c    Wed Dec 23 18:10:02 1992
  551. ***************
  552. *** 169,175 ****
  553.   {
  554.   }
  555.   
  556. ! void Delay(milliseconds)
  557.   unsigned long
  558.     milliseconds;
  559.   {
  560. --- 169,175 ----
  561.   {
  562.   }
  563.   
  564. ! static void Delay(milliseconds)
  565.   unsigned long
  566.     milliseconds;
  567.   {
  568. ***************
  569. *** 1967,1972 ****
  570. --- 1967,1976 ----
  571.         }
  572.       else
  573.         {
  574. +         double
  575. +           normalized_maximum_error,
  576. +           normalized_mean_error;
  577.           Image
  578.             *image,
  579.             info_image,
  580. ***************
  581. *** 1975,1980 ****
  582. --- 1979,1987 ----
  583.           time_t
  584.             start_time;
  585.   
  586. +         unsigned int
  587. +           mean_error_per_pixel;
  588.           unsigned long
  589.             total_colors;
  590.   
  591. ***************
  592. *** 1992,1997 ****
  593. --- 1999,2005 ----
  594.           do
  595.           {
  596.             info_image=(*image);
  597. +           total_colors=0;
  598.             /*
  599.               Transform image as defined by the clip, image and scale geometries.
  600.             */
  601. ***************
  602. *** 2029,2053 ****
  603.               }
  604.             if (gamma > 0.0)
  605.               GammaImage(image,gamma);
  606. -           if (verbose)
  607. -             {
  608. -               /*
  609. -                 Initialize image error attributes.
  610. -               */
  611. -               if (image->class == DirectClass)
  612. -                 image->colors=NumberColors(image,(FILE *) NULL);
  613. -               total_colors=image->colors;
  614. -             }
  615.             if (resource_info.colorspace == GRAYColorspace)
  616.               QuantizeImage(image,256,8,resource_info.dither,GRAYColorspace,True);
  617.             if (resource_info.monochrome)
  618.               QuantizeImage(image,2,8,resource_info.dither,GRAYColorspace,True);
  619. !           if (resource_info.number_colors > 0)
  620.               if ((image->class == DirectClass) ||
  621.                   (image->colors > resource_info.number_colors))
  622. !               QuantizeImage(image,resource_info.number_colors,
  623. !                 resource_info.tree_depth,resource_info.dither,
  624. !                 resource_info.colorspace,True);
  625.             if (verbose)
  626.               {
  627.                 /*
  628. --- 2037,2067 ----
  629.               }
  630.             if (gamma > 0.0)
  631.               GammaImage(image,gamma);
  632.             if (resource_info.colorspace == GRAYColorspace)
  633.               QuantizeImage(image,256,8,resource_info.dither,GRAYColorspace,True);
  634.             if (resource_info.monochrome)
  635.               QuantizeImage(image,2,8,resource_info.dither,GRAYColorspace,True);
  636. !           if (resource_info.number_colors != 0)
  637.               if ((image->class == DirectClass) ||
  638.                   (image->colors > resource_info.number_colors))
  639. !               {
  640. !                 /*
  641. !                   Reduce the number of colors in the image.
  642. !                 */
  643. !                 QuantizeImage(image,resource_info.number_colors,
  644. !                   resource_info.tree_depth,resource_info.dither,
  645. !                   resource_info.colorspace,True);
  646. !                 if (verbose)
  647. !                   {
  648. !                     /*
  649. !                       Measure quantization error.
  650. !                     */
  651. !                     QuantizationError(image,&mean_error_per_pixel,
  652. !                       &normalized_mean_error,&normalized_maximum_error);
  653. !                     total_colors=NumberColors(image,(FILE *) NULL);
  654. !                   }
  655. !                 SyncImage(image);
  656. !               }
  657.             if (verbose)
  658.               {
  659.                 /*
  660. ***************
  661. *** 2065,2087 ****
  662.                   (void) fprintf(stderr," DirectClass ");
  663.                 else
  664.                   (void) fprintf(stderr," PseudoClass ");
  665. !               if (total_colors != image->colors)
  666. !                 (void) fprintf(stderr,"%lu=>",total_colors);
  667. !               (void) fprintf(stderr,"%uc",image->colors);
  668. !               if ((resource_info.number_colors > 0) || resource_info.monochrome)
  669.                   {
  670. !                   double
  671. !                     normalized_maximum_error,
  672. !                     normalized_mean_error;
  673. !                   unsigned int
  674. !                     mean_error_per_pixel;
  675. !                   /*
  676. !                     Measure quantization error.
  677. !                   */
  678. !                   QuantizationError(image,&mean_error_per_pixel,
  679. !                     &normalized_mean_error,&normalized_maximum_error);
  680.                     (void) fprintf(stderr," %u/%.6f/%.6fe",mean_error_per_pixel,
  681.                       normalized_mean_error,normalized_maximum_error);
  682.                   }
  683. --- 2079,2089 ----
  684.                   (void) fprintf(stderr," DirectClass ");
  685.                 else
  686.                   (void) fprintf(stderr," PseudoClass ");
  687. !               if (total_colors == 0)
  688. !                 (void) fprintf(stderr,"%uc",image->colors);
  689. !               else
  690.                   {
  691. !                   (void) fprintf(stderr,"%lu=>%uc",total_colors,image->colors);
  692.                     (void) fprintf(stderr," %u/%.6f/%.6fe",mean_error_per_pixel,
  693.                       normalized_mean_error,normalized_maximum_error);
  694.                   }
  695. diff -r -c ImageMagick/colors.c ImageMagick2.2.3/colors.c
  696. *** ImageMagick/colors.c    Tue Dec 22 16:04:19 1992
  697. --- ImageMagick2.2.3/colors.c    Wed Dec 23 18:10:02 1992
  698. ***************
  699. *** 156,162 ****
  700.       if (node->child[id] != (Node *) NULL)
  701.         Histogram(node->child[id],file);
  702.     if (node->level == MaxTreeDepth)
  703. !     (void) fprintf(file,"%8d\t%d\t%d\t%d\n",node->number_colors,
  704.         node->mid_red,node->mid_green,node->mid_blue);
  705.   }
  706.   
  707. --- 156,162 ----
  708.       if (node->child[id] != (Node *) NULL)
  709.         Histogram(node->child[id],file);
  710.     if (node->level == MaxTreeDepth)
  711. !     (void) fprintf(file,"%8lu\t%d\t%d\t%d\n",node->number_colors,
  712.         node->mid_red,node->mid_green,node->mid_blue);
  713.   }
  714.   
  715. diff -r -c ImageMagick/compress.c ImageMagick2.2.3/compress.c
  716. *** ImageMagick/compress.c    Tue Dec 22 16:04:20 1992
  717. --- ImageMagick2.2.3/compress.c    Wed Dec 23 18:10:02 1992
  718. ***************
  719. *** 1078,1084 ****
  720.         k=((int) (p->index) << (MaxLZWBits-8))+waiting_code;
  721.         if (k >= MaxHashTable)
  722.           k-=MaxHashTable;
  723. !       if (hash_code[k] != 0)
  724.           {
  725.             if ((hash_prefix[k] == waiting_code) &&
  726.                 (hash_suffix[k] == (unsigned char) (p->index & 0xff)))
  727. --- 1078,1084 ----
  728.         k=((int) (p->index) << (MaxLZWBits-8))+waiting_code;
  729.         if (k >= MaxHashTable)
  730.           k-=MaxHashTable;
  731. !       if (hash_code[k] >= 0)
  732.           {
  733.             if ((hash_prefix[k] == waiting_code) &&
  734.                 (hash_suffix[k] == (unsigned char) (p->index & 0xff)))
  735. diff -r -c ImageMagick/display.c ImageMagick2.2.3/display.c
  736. *** ImageMagick/display.c    Tue Dec 22 16:04:22 1992
  737. --- ImageMagick2.2.3/display.c    Wed Dec 23 18:10:03 1992
  738. ***************
  739. *** 625,633 ****
  740.         if (resource_info->number_colors > 0)
  741.           if ((output_image->class == DirectClass) ||
  742.               (output_image->colors > resource_info->number_colors))
  743. !           QuantizeImage(output_image,resource_info->number_colors,
  744. !             resource_info->tree_depth,resource_info->dither,
  745. !             resource_info->colorspace,True);
  746.         (void) strcpy(output_image->filename,filename);
  747.         if (command == 'p')
  748.           (void) PrintImage(output_image,resource_info->image_geometry);
  749. --- 625,636 ----
  750.         if (resource_info->number_colors > 0)
  751.           if ((output_image->class == DirectClass) ||
  752.               (output_image->colors > resource_info->number_colors))
  753. !           {
  754. !             QuantizeImage(output_image,resource_info->number_colors,
  755. !               resource_info->tree_depth,resource_info->dither,
  756. !               resource_info->colorspace,True);
  757. !             SyncImage(output_image);
  758. !           }
  759.         (void) strcpy(output_image->filename,filename);
  760.         if (command == 'p')
  761.           (void) PrintImage(output_image,resource_info->image_geometry);
  762. ***************
  763. *** 668,674 ****
  764.         break;
  765.       }
  766.     }
  767. !   if ((width > 0) && (height > 0))
  768.       {
  769.         unsigned int
  770.           mask;
  771. --- 671,677 ----
  772.         break;
  773.       }
  774.     }
  775. !   if ((width != 0) && (height != 0))
  776.       {
  777.         unsigned int
  778.           mask;
  779. ***************
  780. *** 2193,2199 ****
  781.         /*
  782.           Free previous resources on the root window.
  783.         */
  784. !       XKillClient(display,*((Pixmap *) data));
  785.         XFree((void *) data);
  786.       }
  787.     /*
  788. --- 2196,2202 ----
  789.         /*
  790.           Free previous resources on the root window.
  791.         */
  792. !       XKillClient(display,(XID) (*((Pixmap *) data)));
  793.         XFree((void *) data);
  794.       }
  795.     /*
  796. ***************
  797. *** 2926,2932 ****
  798.     *state&=(~NextImageState);
  799.     *state&=(~TileImageState);
  800.     if (resource_info->delay == 0)
  801. !     timeout=(~0);
  802.     else
  803.       timeout=(unsigned long) time((time_t *) 0)+resource_info->delay;
  804.     do
  805. --- 2929,2935 ----
  806.     *state&=(~NextImageState);
  807.     *state&=(~TileImageState);
  808.     if (resource_info->delay == 0)
  809. !     timeout=(unsigned long) (~0);
  810.     else
  811.       timeout=(unsigned long) time((time_t *) 0)+resource_info->delay;
  812.     do
  813. ***************
  814. *** 3179,3185 ****
  815.                   Reset timeout after expose.
  816.                 */
  817.                 if (resource_info->delay == 0)
  818. !                 timeout=(~0);
  819.                 else
  820.                   timeout=(unsigned long) time((time_t *) 0)+resource_info->delay;
  821.                 break;
  822. --- 3182,3188 ----
  823.                   Reset timeout after expose.
  824.                 */
  825.                 if (resource_info->delay == 0)
  826. !                 timeout=(unsigned long) (~0);
  827.                 else
  828.                   timeout=(unsigned long) time((time_t *) 0)+resource_info->delay;
  829.                 break;
  830. ***************
  831. *** 3513,3521 ****
  832.         if (resource_info->number_colors > 0)
  833.           if ((displayed_image->class == DirectClass) ||
  834.               (displayed_image->colors > resource_info->number_colors))
  835. !           QuantizeImage(displayed_image,resource_info->number_colors,
  836. !             resource_info->tree_depth,resource_info->dither,
  837. !             resource_info->colorspace,True);
  838.       }
  839.     /*
  840.       Free X resources.
  841. --- 3516,3527 ----
  842.         if (resource_info->number_colors > 0)
  843.           if ((displayed_image->class == DirectClass) ||
  844.               (displayed_image->colors > resource_info->number_colors))
  845. !           {
  846. !             QuantizeImage(displayed_image,resource_info->number_colors,
  847. !               resource_info->tree_depth,resource_info->dither,
  848. !               resource_info->colorspace,True);
  849. !             SyncImage(displayed_image);
  850. !           }
  851.       }
  852.     /*
  853.       Free X resources.
  854. ***************
  855. *** 4109,4115 ****
  856.                       p++;
  857.                       p_bit=0;
  858.                     }
  859. !                 if (q_bit > 0)
  860.                     *q=byte >> (8-q_bit);
  861.                   q+=scanline_pad;
  862.                 }
  863. --- 4115,4121 ----
  864.                       p++;
  865.                       p_bit=0;
  866.                     }
  867. !                 if (q_bit != 0)
  868.                     *q=byte >> (8-q_bit);
  869.                   q+=scanline_pad;
  870.                 }
  871. ***************
  872. *** 4166,4172 ****
  873.                       p++;
  874.                       p_bit=0;
  875.                     }
  876. !                 if (q_bit > 0)
  877.                     *q=byte << (8-q_bit);
  878.                   q+=scanline_pad;
  879.                 }
  880. --- 4172,4178 ----
  881.                       p++;
  882.                       p_bit=0;
  883.                     }
  884. !                 if (q_bit != 0)
  885.                     *q=byte << (8-q_bit);
  886.                   q+=scanline_pad;
  887.                 }
  888. ***************
  889. *** 5556,5561 ****
  890. --- 5562,5571 ----
  891.         }
  892.       else
  893.         {
  894. +         double
  895. +           normalized_maximum_error,
  896. +           normalized_mean_error;
  897.           Image
  898.             *image,
  899.             info_image,
  900. ***************
  901. *** 5564,5570 ****
  902.           time_t
  903.             start_time;
  904.   
  905. !         unsigned long
  906.             total_colors;
  907.   
  908.           /*
  909. --- 5574,5583 ----
  910.           time_t
  911.             start_time;
  912.   
  913. !         unsigned int
  914. !           mean_error_per_pixel;
  915. !         unsigned long int
  916.             total_colors;
  917.   
  918.           /*
  919. ***************
  920. *** 5581,5588 ****
  921.           do
  922.           {
  923.             info_image=(*image);
  924. !           if (scene > 0)
  925.               image->scene=scene;
  926.             /*
  927.               Transform image as defined by the clip, image and scale geometries.
  928.             */
  929. --- 5594,5602 ----
  930.           do
  931.           {
  932.             info_image=(*image);
  933. !           if (scene != 0)
  934.               image->scene=scene;
  935. +           total_colors=0;
  936.             /*
  937.               Transform image as defined by the clip, image and scale geometries.
  938.             */
  939. ***************
  940. *** 5654,5678 ****
  941.               InverseImage(image);
  942.             if (normalize)
  943.               NormalizeImage(image);
  944. -           if (verbose)
  945. -             {
  946. -               /*
  947. -                 Initialize image error attributes.
  948. -               */
  949. -               if (image->class == DirectClass)
  950. -                 image->colors=NumberColors(image,(FILE *) NULL);
  951. -               total_colors=image->colors;
  952. -             }
  953.             if (resource_info.colorspace == GRAYColorspace)
  954.               QuantizeImage(image,256,8,resource_info.dither,GRAYColorspace,True);
  955.             if (resource_info.monochrome)
  956.               QuantizeImage(image,2,8,resource_info.dither,GRAYColorspace,True);
  957. !           if (resource_info.number_colors > 0)
  958.               if ((image->class == DirectClass) ||
  959.                   (image->colors > resource_info.number_colors))
  960. !               QuantizeImage(image,resource_info.number_colors,
  961. !                 resource_info.tree_depth,resource_info.dither,
  962. !                 resource_info.colorspace,True);
  963.             /*
  964.               Display image to X server.
  965.             */
  966. --- 5668,5698 ----
  967.               InverseImage(image);
  968.             if (normalize)
  969.               NormalizeImage(image);
  970.             if (resource_info.colorspace == GRAYColorspace)
  971.               QuantizeImage(image,256,8,resource_info.dither,GRAYColorspace,True);
  972.             if (resource_info.monochrome)
  973.               QuantizeImage(image,2,8,resource_info.dither,GRAYColorspace,True);
  974. !           if (resource_info.number_colors != 0)
  975.               if ((image->class == DirectClass) ||
  976.                   (image->colors > resource_info.number_colors))
  977. !               {
  978. !                 /*
  979. !                   Reduce the number of colors in the image.
  980. !                 */
  981. !                 QuantizeImage(image,resource_info.number_colors,
  982. !                   resource_info.tree_depth,resource_info.dither,
  983. !                   resource_info.colorspace,True);
  984. !                 if (verbose)
  985. !                   {
  986. !                     /*
  987. !                       Measure quantization error.
  988. !                     */
  989. !                     QuantizationError(image,&mean_error_per_pixel,
  990. !                       &normalized_mean_error,&normalized_maximum_error);
  991. !                     total_colors=NumberColors(image,(FILE *) NULL);
  992. !                   }
  993. !                 SyncImage(image);
  994. !               }
  995.             /*
  996.               Display image to X server.
  997.             */
  998. ***************
  999. *** 5744,5766 ****
  1000.                   (void) fprintf(stderr," DirectClass ");
  1001.                 else
  1002.                   (void) fprintf(stderr," PseudoClass ");
  1003. !               if (total_colors != image->colors)
  1004. !                 (void) fprintf(stderr,"%lu=>",total_colors);
  1005. !               (void) fprintf(stderr,"%uc",image->colors);
  1006. !               if ((resource_info.number_colors > 0) || resource_info.monochrome)
  1007.                   {
  1008. !                   double
  1009. !                     normalized_maximum_error,
  1010. !                     normalized_mean_error;
  1011. !                   unsigned int
  1012. !                     mean_error_per_pixel;
  1013. !                   /*
  1014. !                     Measure quantization error.
  1015. !                   */
  1016. !                   QuantizationError(image,&mean_error_per_pixel,
  1017. !                     &normalized_mean_error,&normalized_maximum_error);
  1018.                     (void) fprintf(stderr," %u/%.6f/%.6fe",mean_error_per_pixel,
  1019.                       normalized_mean_error,normalized_maximum_error);
  1020.                   }
  1021. --- 5764,5774 ----
  1022.                   (void) fprintf(stderr," DirectClass ");
  1023.                 else
  1024.                   (void) fprintf(stderr," PseudoClass ");
  1025. !               if (total_colors == 0)
  1026. !                 (void) fprintf(stderr,"%uc",image->colors);
  1027. !               else
  1028.                   {
  1029. !                   (void) fprintf(stderr,"%lu=>%uc",total_colors,image->colors);
  1030.                     (void) fprintf(stderr," %u/%.6f/%.6fe",mean_error_per_pixel,
  1031.                       normalized_mean_error,normalized_maximum_error);
  1032.                   }
  1033. ***************
  1034. *** 5791,5797 ****
  1035.               for (i--; i > 0; i--)
  1036.                 if (image_marker[i] == (image_number-2))
  1037.                   break;
  1038. !             if (image_number > 0)
  1039.                 image_number--;
  1040.             }
  1041.         }
  1042. --- 5799,5805 ----
  1043.               for (i--; i > 0; i--)
  1044.                 if (image_marker[i] == (image_number-2))
  1045.                   break;
  1046. !             if (image_number != 0)
  1047.                 image_number--;
  1048.             }
  1049.         }
  1050. diff -r -c ImageMagick/display.h ImageMagick2.2.3/display.h
  1051. *** ImageMagick/display.h    Tue Dec 22 16:23:32 1992
  1052. --- ImageMagick2.2.3/display.h    Wed Dec 23 18:10:04 1992
  1053. ***************
  1054. *** 51,55 ****
  1055.   */
  1056.   #ifndef lint
  1057.   static char 
  1058. !   Version[]="@(#)ImageMagick 2.2.2 92/12/22 cristy@dupont.com";
  1059.   #endif
  1060. --- 51,55 ----
  1061.   */
  1062.   #ifndef lint
  1063.   static char 
  1064. !   Version[]="@(#)ImageMagick 2.2.3 93/01/01 cristy@dupont.com";
  1065.   #endif
  1066. diff -r -c ImageMagick/image.c ImageMagick2.2.3/image.c
  1067. *** ImageMagick/image.c    Tue Dec 22 16:06:19 1992
  1068. --- ImageMagick2.2.3/image.c    Wed Dec 23 18:10:03 1992
  1069. ***************
  1070. *** 62,67 ****
  1071. --- 62,73 ----
  1072.     *client_name;
  1073.   
  1074.   /*
  1075. +   Forward declarations.
  1076. + */
  1077. + static Image
  1078. +   *ZoomImage _Declare((Image *));
  1079. + /*
  1080.   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1081.   %                                                                             %
  1082.   %                                                                             %
  1083. ***************
  1084. *** 1597,1605 ****
  1085.       }
  1086.       case PseudoClass:
  1087.       {
  1088. -       register unsigned short
  1089. -         index;
  1090.         /*
  1091.           Gamma-correct PseudoClass image.
  1092.         */
  1093. --- 1603,1608 ----
  1094. ***************
  1095. *** 1609,1623 ****
  1096.           image->colormap[i].green=gamma_map[image->colormap[i].green];
  1097.           image->colormap[i].blue=gamma_map[image->colormap[i].blue];
  1098.         }
  1099. !       p=image->pixels;
  1100. !       for (i=0; i < image->packets; i++)
  1101. !       {
  1102. !         index=p->index;
  1103. !         p->red=image->colormap[index].red;
  1104. !         p->green=image->colormap[index].green;
  1105. !         p->blue=image->colormap[index].blue;
  1106. !         p++;
  1107. !       }
  1108.         break;
  1109.       }
  1110.     }
  1111. --- 1612,1618 ----
  1112.           image->colormap[i].green=gamma_map[image->colormap[i].green];
  1113.           image->colormap[i].blue=gamma_map[image->colormap[i].blue];
  1114.         }
  1115. !       SyncImage(image);
  1116.         break;
  1117.       }
  1118.     }
  1119. ***************
  1120. *** 1675,1683 ****
  1121.       }
  1122.       case PseudoClass:
  1123.       {
  1124. -       register unsigned short
  1125. -         index;
  1126.         /*
  1127.           Inverse PseudoClass packets.
  1128.         */
  1129. --- 1670,1675 ----
  1130. ***************
  1131. *** 1687,1701 ****
  1132.           image->colormap[i].green=(~image->colormap[i].green);
  1133.           image->colormap[i].blue=(~image->colormap[i].blue);
  1134.         }
  1135. !       p=image->pixels;
  1136. !       for (i=0; i < image->packets; i++)
  1137. !       {
  1138. !         index=p->index;
  1139. !         p->red=image->colormap[index].red;
  1140. !         p->green=image->colormap[index].green;
  1141. !         p->blue=image->colormap[index].blue;
  1142. !         p++;
  1143. !       }
  1144.         break;
  1145.       }
  1146.     }
  1147. --- 1679,1685 ----
  1148.           image->colormap[i].green=(~image->colormap[i].green);
  1149.           image->colormap[i].blue=(~image->colormap[i].blue);
  1150.         }
  1151. !       SyncImage(image);
  1152.         break;
  1153.       }
  1154.     }
  1155. ***************
  1156. *** 2032,2038 ****
  1157.         break;
  1158.     }
  1159.     intensity=0;
  1160. !   for (high=MaxRGB; high > 0; high--)
  1161.     {
  1162.       intensity+=histogram[high];
  1163.       if (intensity > threshold_intensity)
  1164. --- 2016,2022 ----
  1165.         break;
  1166.     }
  1167.     intensity=0;
  1168. !   for (high=MaxRGB; high != 0; high--)
  1169.     {
  1170.       intensity+=histogram[high];
  1171.       if (intensity > threshold_intensity)
  1172. ***************
  1173. *** 2052,2058 ****
  1174.             break;
  1175.         }
  1176.         intensity=0;
  1177. !       for (high=MaxRGB; high > 0; high--)
  1178.         {
  1179.           intensity+=histogram[high];
  1180.           if (intensity > threshold_intensity)
  1181. --- 2036,2042 ----
  1182.             break;
  1183.         }
  1184.         intensity=0;
  1185. !       for (high=MaxRGB; high != 0; high--)
  1186.         {
  1187.           intensity+=histogram[high];
  1188.           if (intensity > threshold_intensity)
  1189. ***************
  1190. *** 2094,2102 ****
  1191.       }
  1192.       case PseudoClass:
  1193.       {
  1194. -       register unsigned short
  1195. -         index;
  1196.         /*
  1197.           Normalize PseudoClass image.
  1198.         */
  1199. --- 2078,2083 ----
  1200. ***************
  1201. *** 2106,2120 ****
  1202.           image->colormap[i].green=normalize_map[image->colormap[i].green];
  1203.           image->colormap[i].blue=normalize_map[image->colormap[i].blue];
  1204.         }
  1205. !       p=image->pixels;
  1206. !       for (i=0; i < image->packets; i++)
  1207. !       {
  1208. !         index=p->index;
  1209. !         p->red=image->colormap[index].red;
  1210. !         p->green=image->colormap[index].green;
  1211. !         p->blue=image->colormap[index].blue;
  1212. !         p++;
  1213. !       }
  1214.         break;
  1215.       }
  1216.     }
  1217. --- 2087,2093 ----
  1218.           image->colormap[i].green=normalize_map[image->colormap[i].green];
  1219.           image->colormap[i].blue=normalize_map[image->colormap[i].blue];
  1220.         }
  1221. !       SyncImage(image);
  1222.         break;
  1223.       }
  1224.     }
  1225. ***************
  1226. *** 3502,3508 ****
  1227.   %
  1228.   %
  1229.   */
  1230. ! Image *ReduceImage(image)
  1231.   Image
  1232.     *image;
  1233.   {
  1234. --- 3475,3481 ----
  1235.   %
  1236.   %
  1237.   */
  1238. ! static Image *ReduceImage(image)
  1239.   Image
  1240.     *image;
  1241.   {
  1242. ***************
  1243. *** 4005,4013 ****
  1244.       }
  1245.       case PseudoClass:
  1246.       {
  1247. -       register unsigned short
  1248. -         index;
  1249.         /*
  1250.           Convert PseudoClass image.
  1251.         */
  1252. --- 3978,3983 ----
  1253. ***************
  1254. *** 4023,4037 ****
  1255.           image->colormap[i].blue=
  1256.             range_limit[DownShift(x[red+Z]+y[green+Z]+z[blue+Z]+tz)];
  1257.         }
  1258. !       p=image->pixels;
  1259. !       for (i=0; i < image->packets; i++)
  1260. !       {
  1261. !         index=p->index;
  1262. !         p->red=image->colormap[index].red;
  1263. !         p->green=image->colormap[index].green;
  1264. !         p->blue=image->colormap[index].blue;
  1265. !         p++;
  1266. !       }
  1267.         break;
  1268.       }
  1269.     }
  1270. --- 3993,3999 ----
  1271.           image->colormap[i].blue=
  1272.             range_limit[DownShift(x[red+Z]+y[green+Z]+z[blue+Z]+tz)];
  1273.         }
  1274. !       SyncImage(image);
  1275.         break;
  1276.       }
  1277.     }
  1278. ***************
  1279. *** 4082,4088 ****
  1280.   Image
  1281.     *image;
  1282.   
  1283. ! unsigned int
  1284.     x_offset,
  1285.     y_offset;
  1286.   {
  1287. --- 4044,4050 ----
  1288.   Image
  1289.     *image;
  1290.   
  1291. ! int
  1292.     x_offset,
  1293.     y_offset;
  1294.   {
  1295. ***************
  1296. *** 4540,4545 ****
  1297. --- 4502,4554 ----
  1298.     return(stereo_image);
  1299.   }
  1300.   
  1301. + /*
  1302. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1303. + %                                                                             %
  1304. + %                                                                             %
  1305. + %                                                                             %
  1306. + %   S y n c I m a g e                                                         %
  1307. + %                                                                             %
  1308. + %                                                                             %
  1309. + %                                                                             %
  1310. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1311. + %
  1312. + %  Function SyncImage initializes the red, green, and blue intensities of each
  1313. + %  pixel as defined by the colormap index.
  1314. + %
  1315. + %  The format of the SyncImage routine is:
  1316. + %
  1317. + %      SyncImage(image)
  1318. + %
  1319. + %  A description of each parameter follows:
  1320. + %
  1321. + %    o image: The address of a structure of type Image.
  1322. + %
  1323. + %
  1324. + */
  1325. + void SyncImage(image)
  1326. + Image
  1327. +   *image;
  1328. + {
  1329. +   register int
  1330. +     i;
  1331. +   register RunlengthPacket
  1332. +     *p;
  1333. +   register unsigned short
  1334. +     index;
  1335. +   p=image->pixels;
  1336. +   for (i=0; i < image->packets; i++)
  1337. +   {
  1338. +     index=p->index;
  1339. +     p->red=image->colormap[index].red;
  1340. +     p->green=image->colormap[index].green;
  1341. +     p->blue=image->colormap[index].blue;
  1342. +     p++;
  1343. +   }
  1344. + }
  1345.   
  1346.   /*
  1347.   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1348. ***************
  1349. *** 5430,5436 ****
  1350.   %
  1351.   %
  1352.   */
  1353. ! Image *ZoomImage(image)
  1354.   Image
  1355.     *image;
  1356.   {
  1357. --- 5439,5445 ----
  1358.   %
  1359.   %
  1360.   */
  1361. ! static Image *ZoomImage(image)
  1362.   Image
  1363.     *image;
  1364.   {
  1365. diff -r -c ImageMagick/image.h ImageMagick2.2.3/image.h
  1366. *** ImageMagick/image.h    Tue Dec 22 16:04:24 1992
  1367. --- ImageMagick2.2.3/image.h    Wed Dec 23 18:33:18 1992
  1368. ***************
  1369. *** 146,159 ****
  1370.     *EnhanceImage _Declare((Image *)),
  1371.     *NoisyImage _Declare((Image *)),
  1372.     *ReadImage _Declare((char *)),
  1373. -   *ReduceImage _Declare((Image *)),
  1374.     *ReflectImage _Declare((Image *)),
  1375. !   *RollImage _Declare((Image *,unsigned int,unsigned int)),
  1376. !   *RotateImage _Declare((Image *,double,int)),
  1377.     *ScaleImage _Declare((Image *,unsigned int,unsigned int)),
  1378.     *ShearImage _Declare((Image *,double,double,unsigned int)),
  1379. !   *StereoImage _Declare((Image *,Image *)),
  1380. !   *ZoomImage _Declare((Image *));
  1381.   
  1382.   extern int
  1383.     ReadDataBlock _Declare((char *,FILE *));
  1384. --- 146,157 ----
  1385.     *EnhanceImage _Declare((Image *)),
  1386.     *NoisyImage _Declare((Image *)),
  1387.     *ReadImage _Declare((char *)),
  1388.     *ReflectImage _Declare((Image *)),
  1389. !   *RollImage _Declare((Image *,int,int)),
  1390. !   *RotateImage _Declare((Image *,double,unsigned int)),
  1391.     *ScaleImage _Declare((Image *,unsigned int,unsigned int)),
  1392.     *ShearImage _Declare((Image *,double,double,unsigned int)),
  1393. !   *StereoImage _Declare((Image *,Image *));
  1394.   
  1395.   extern int
  1396.     ReadDataBlock _Declare((char *,FILE *));
  1397. ***************
  1398. *** 186,190 ****
  1399. --- 184,189 ----
  1400.       unsigned int,unsigned int,unsigned int,unsigned int)),
  1401.     RGBTransformImage _Declare((Image *,unsigned int)),
  1402.     SortColormapByIntensity _Declare((Image *)),
  1403. +   SyncImage _Declare((Image *)),
  1404.     TransformImage _Declare((Image **,char *,char *,char *)),
  1405.     TransformRGBImage _Declare((Image *,unsigned int));
  1406. Common subdirectories: ImageMagick/images and ImageMagick2.2.3/images
  1407. diff -r -c ImageMagick/import.c ImageMagick2.2.3/import.c
  1408. *** ImageMagick/import.c    Tue Dec 22 16:04:24 1992
  1409. --- ImageMagick2.2.3/import.c    Wed Dec 23 18:10:03 1992
  1410. ***************
  1411. *** 433,439 ****
  1412.     /*
  1413.       Read image from X server.
  1414.     */
  1415. !   if (resource_info.delay > 0)
  1416.       (void) sleep(resource_info.delay);
  1417.     start_time=time((time_t *) 0);
  1418.     image=ReadXImage(target_window,server_name,frame,screen,borders);
  1419. --- 433,439 ----
  1420.     /*
  1421.       Read image from X server.
  1422.     */
  1423. !   if (resource_info.delay != 0)
  1424.       (void) sleep(resource_info.delay);
  1425.     start_time=time((time_t *) 0);
  1426.     image=ReadXImage(target_window,server_name,frame,screen,borders);
  1427. ***************
  1428. *** 459,465 ****
  1429.           (void) fprintf(stderr," DirectClass ");
  1430.         else
  1431.           (void) fprintf(stderr," PseudoClass ");
  1432. !       (void) fprintf(stderr,"%dc %s %ds\n",image->colors,image->magick,
  1433.           time((time_t *) 0)-start_time+1);
  1434.       }
  1435.     DestroyImage(image);
  1436. --- 459,465 ----
  1437.           (void) fprintf(stderr," DirectClass ");
  1438.         else
  1439.           (void) fprintf(stderr," PseudoClass ");
  1440. !       (void) fprintf(stderr,"%dc %s %lds\n",image->colors,image->magick,
  1441.           time((time_t *) 0)-start_time+1);
  1442.       }
  1443.     DestroyImage(image);
  1444. diff -r -c ImageMagick/montage.c ImageMagick2.2.3/montage.c
  1445. *** ImageMagick/montage.c    Tue Dec 22 16:04:25 1992
  1446. --- ImageMagick2.2.3/montage.c    Wed Dec 23 18:10:04 1992
  1447. ***************
  1448. *** 249,255 ****
  1449.       tile_border_height,
  1450.       tile_border_width,
  1451.       x,
  1452. !     y;
  1453.   
  1454.     register char
  1455.       *q;
  1456. --- 249,257 ----
  1457.       tile_border_height,
  1458.       tile_border_width,
  1459.       x,
  1460. !     x_offset,
  1461. !     y,
  1462. !     y_offset;
  1463.   
  1464.     register char
  1465.       *q;
  1466. ***************
  1467. *** 266,274 ****
  1468.       status,
  1469.       tile,
  1470.       tile_height,
  1471. !     tile_width,
  1472. !     x_offset,
  1473. !     y_offset;
  1474.   
  1475.     XAnnotateInfo
  1476.       annotate_info;
  1477. --- 268,274 ----
  1478.       status,
  1479.       tile,
  1480.       tile_height,
  1481. !     tile_width;
  1482.   
  1483.     XAnnotateInfo
  1484.       annotate_info;
  1485. ***************
  1486. *** 488,494 ****
  1487.       status=UnpackImage(image);
  1488.       if (status == False)
  1489.         Error("unable to unpack image",(char *) NULL);
  1490. !     if (border_width > 0)
  1491.         {
  1492.           Image
  1493.             *bordered_image;
  1494. --- 488,494 ----
  1495.       status=UnpackImage(image);
  1496.       if (status == False)
  1497.         Error("unable to unpack image",(char *) NULL);
  1498. !     if (border_width != 0)
  1499.         {
  1500.           Image
  1501.             *bordered_image;
  1502. ***************
  1503. *** 1396,1408 ****
  1504.       QuantizeImage(montage_image,256,8,resource_info.dither,GRAYColorspace,True);
  1505.     if (resource_info.monochrome)
  1506.       QuantizeImage(montage_image,2,8,resource_info.dither,GRAYColorspace,True);
  1507. !   if (resource_info.number_colors > 0)
  1508. !     QuantizeImage(montage_image,resource_info.number_colors,
  1509. !       resource_info.tree_depth,resource_info.dither,resource_info.colorspace,
  1510. !       True);
  1511.     if (compression != UndefinedCompression)
  1512.       montage_image->compression=compression;
  1513. !   strcpy(montage_image->filename,write_filename);
  1514.     (void) WriteAlienImage(montage_image);
  1515.     if (verbose)
  1516.       {
  1517. --- 1396,1411 ----
  1518.       QuantizeImage(montage_image,256,8,resource_info.dither,GRAYColorspace,True);
  1519.     if (resource_info.monochrome)
  1520.       QuantizeImage(montage_image,2,8,resource_info.dither,GRAYColorspace,True);
  1521. !   if (resource_info.number_colors != 0)
  1522. !     {
  1523. !       QuantizeImage(montage_image,resource_info.number_colors,
  1524. !         resource_info.tree_depth,resource_info.dither,resource_info.colorspace,
  1525. !         True);
  1526. !       SyncImage(montage_image);
  1527. !     }
  1528.     if (compression != UndefinedCompression)
  1529.       montage_image->compression=compression;
  1530. !   (void) strcpy(montage_image->filename,write_filename);
  1531.     (void) WriteAlienImage(montage_image);
  1532.     if (verbose)
  1533.       {
  1534. diff -r -c ImageMagick/quantize.c ImageMagick2.2.3/quantize.c
  1535. *** ImageMagick/quantize.c    Tue Dec 22 16:06:18 1992
  1536. --- ImageMagick2.2.3/quantize.c    Wed Dec 23 18:10:04 1992
  1537. ***************
  1538. *** 430,436 ****
  1539.           cube.color.red=p->red;
  1540.           cube.color.green=p->green;
  1541.           cube.color.blue=p->blue;
  1542. !         cube.distance=(~0);
  1543.           ClosestColor(node->parent);
  1544.           p->index=cube.color_number;
  1545.           p++;
  1546. --- 430,436 ----
  1547.           cube.color.red=p->red;
  1548.           cube.color.green=p->green;
  1549.           cube.color.blue=p->blue;
  1550. !         cube.distance=(unsigned long int) (~0);
  1551.           ClosestColor(node->parent);
  1552.           p->index=cube.color_number;
  1553.           p++;
  1554. ***************
  1555. *** 900,906 ****
  1556.             cube.color.red=red;
  1557.             cube.color.green=green;
  1558.             cube.color.blue=blue;
  1559. !           cube.distance=(~0);
  1560.             ClosestColor(node->parent);
  1561.             cache[i]=cube.color_number;
  1562.           }
  1563. --- 900,906 ----
  1564.             cube.color.red=red;
  1565.             cube.color.green=green;
  1566.             cube.color.blue=blue;
  1567. !           cube.distance=(unsigned long int) (~0);
  1568.             ClosestColor(node->parent);
  1569.             cache[i]=cube.color_number;
  1570.           }
  1571. ***************
  1572. *** 1020,1026 ****
  1573.     /*
  1574.       Initialize the shift values.
  1575.     */
  1576. !   for (max_shift=0; number_pixels > 0; max_shift++)
  1577.       number_pixels<<=1;
  1578.     for (level=0; level < cube.depth; level++)
  1579.     {
  1580. --- 1020,1026 ----
  1581.     /*
  1582.       Initialize the shift values.
  1583.     */
  1584. !   for (max_shift=0; number_pixels != 0; max_shift++)
  1585.       number_pixels<<=1;
  1586.     for (level=0; level < cube.depth; level++)
  1587.     {
  1588. ***************
  1589. *** 1044,1050 ****
  1590.         exit(1);
  1591.       }
  1592.     cube.root->parent=cube.root;
  1593. !   cube.root->number_colors=(~0);
  1594.     cube.colors=0;
  1595.   }
  1596.   
  1597. --- 1044,1050 ----
  1598.         exit(1);
  1599.       }
  1600.     cube.root->parent=cube.root;
  1601. !   cube.root->number_colors=(unsigned long int) (~0);
  1602.     cube.colors=0;
  1603.   }
  1604.   
  1605. ***************
  1606. *** 1552,1558 ****
  1607.       RGBTransformImage(image,colorspace);
  1608.     Classification(image);
  1609.     if (!optimal)
  1610. !     dither|=cube.colors > (1 << (cube.depth-1));
  1611.     Reduction(number_colors);
  1612.     Assignment(image,dither,optimal);
  1613.     if (colorspace != RGBColorspace)
  1614. --- 1552,1558 ----
  1615.       RGBTransformImage(image,colorspace);
  1616.     Classification(image);
  1617.     if (!optimal)
  1618. !     dither|=(cube.colors > (1 << (cube.depth-1)));
  1619.     Reduction(number_colors);
  1620.     Assignment(image,dither,optimal);
  1621.     if (colorspace != RGBColorspace)
  1622. ***************
  1623. *** 1689,1695 ****
  1624.         Classification(images[i]);
  1625.     }
  1626.     if (!optimal)
  1627. !     dither|=cube.colors > (1 << (cube.depth-1));
  1628.     Reduction(number_colors);
  1629.     for (i=0; i < number_images; i++)
  1630.     {
  1631. --- 1689,1695 ----
  1632.         Classification(images[i]);
  1633.     }
  1634.     if (!optimal)
  1635. !     dither|=(cube.colors > (1 << (cube.depth-1)));
  1636.     Reduction(number_colors);
  1637.     for (i=0; i < number_images; i++)
  1638.     {
  1639. Only in ImageMagick2.2.3: rotate.c
  1640. Common subdirectories: ImageMagick/scenes and ImageMagick2.2.3/scenes
  1641. diff -r -c ImageMagick/shear.c ImageMagick2.2.3/shear.c
  1642. *** ImageMagick/shear.c    Tue Dec 22 16:04:26 1992
  1643. --- ImageMagick2.2.3/shear.c    Wed Dec 23 21:12:31 1992
  1644. ***************
  1645. *** 940,946 ****
  1646.   double
  1647.     degrees;
  1648.   
  1649. ! int
  1650.     clip;
  1651.   {
  1652.     ColorPacket
  1653. --- 940,946 ----
  1654.   double
  1655.     degrees;
  1656.   
  1657. ! unsigned int
  1658.     clip;
  1659.   {
  1660.     ColorPacket
  1661. ***************
  1662. *** 1038,1044 ****
  1663.     background.red=image->pixels[0].red;
  1664.     background.green=image->pixels[0].green;
  1665.     background.blue=image->pixels[0].blue;
  1666. !   rotated_image=BorderImage(integral_image,x_offset,y_offset+1,background);
  1667.     DestroyImage(integral_image);
  1668.     if (rotated_image == (Image *) NULL)
  1669.       {
  1670. --- 1038,1045 ----
  1671.     background.red=image->pixels[0].red;
  1672.     background.green=image->pixels[0].green;
  1673.     background.blue=image->pixels[0].blue;
  1674. !   rotated_image=BorderImage(integral_image,(unsigned int) x_offset,
  1675. !     (unsigned int) y_offset+1,background);
  1676.     DestroyImage(integral_image);
  1677.     if (rotated_image == (Image *) NULL)
  1678.       {
  1679. ***************
  1680. *** 1187,1193 ****
  1681.     background.red=image->pixels[0].red;
  1682.     background.green=image->pixels[0].green;
  1683.     background.blue=image->pixels[0].blue;
  1684. !   sheared_image=BorderImage(image,x_offset,y_offset+1,background);
  1685.     if (sheared_image == (Image *) NULL)
  1686.       {
  1687.         Warning("unable to rotate image","memory allocation failed");
  1688. --- 1188,1195 ----
  1689.     background.red=image->pixels[0].red;
  1690.     background.green=image->pixels[0].green;
  1691.     background.blue=image->pixels[0].blue;
  1692. !   sheared_image=BorderImage(image,(unsigned int) x_offset,
  1693. !     (unsigned int) y_offset+1,background);
  1694.     if (sheared_image == (Image *) NULL)
  1695.       {
  1696.         Warning("unable to rotate image","memory allocation failed");
  1697. diff -r -c ImageMagick/signature.c ImageMagick2.2.3/signature.c
  1698. *** ImageMagick/signature.c    Tue Dec 22 16:04:27 1992
  1699. --- ImageMagick2.2.3/signature.c    Wed Dec 23 18:10:04 1992
  1700. ***************
  1701. *** 244,265 ****
  1702.     static unsigned long int
  1703.       additive_constant[64]=  /* 4294967296*abs(sin(i)), i in radians */
  1704.       {
  1705. !       3614090360L, 3905402710L,  606105819L, 3250441966L,
  1706. !       4118548399L, 1200080426L, 2821735955L, 4249261313L,
  1707. !       1770035416L, 2336552879L, 4294925233L, 2304563134L,
  1708. !       1804603682L, 4254626195L, 2792965006L, 1236535329L,
  1709. !       4129170786L, 3225465664L,  643717713L, 3921069994L,
  1710. !       3593408605L,   38016083L, 3634488961L, 3889429448L,
  1711. !        568446438L, 3275163606L, 4107603335L, 1163531501L,
  1712. !       2850285829L, 4243563512L, 1735328473L, 2368359562L,
  1713. !       4294588738L, 2272392833L, 1839030562L, 4259657740L,
  1714. !       2763975236L, 1272893353L, 4139469664L, 3200236656L,
  1715. !        681279174L, 3936430074L, 3572445317L,   76029189L,
  1716. !       3654602809L, 3873151461L,  530742520L, 3299628645L,
  1717. !       4096336452L, 1126891415L, 2878612391L, 4237533241L,
  1718. !       1700485571L, 2399980690L, 4293915773L, 2240044497L,
  1719. !       1873313359L, 4264355552L, 2734768916L, 1309151649L,
  1720. !       4149444226L, 3173756917L,  718787259L, 3951481745L
  1721.       };
  1722.   
  1723.     register int
  1724. --- 244,262 ----
  1725.     static unsigned long int
  1726.       additive_constant[64]=  /* 4294967296*abs(sin(i)), i in radians */
  1727.       {
  1728. !       0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee, 0xf57c0faf,
  1729. !       0x4787c62a, 0xa8304613, 0xfd469501, 0x698098d8, 0x8b44f7af,
  1730. !       0xffff5bb1, 0x895cd7be, 0x6b901122, 0xfd987193, 0xa679438e,
  1731. !       0x49b40821, 0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa,
  1732. !       0xd62f105d, 0x2441453,  0xd8a1e681, 0xe7d3fbc8, 0x21e1cde6,
  1733. !       0xc33707d6, 0xf4d50d87, 0x455a14ed, 0xa9e3e905, 0xfcefa3f8,
  1734. !       0x676f02d9, 0x8d2a4c8a, 0xfffa3942, 0x8771f681, 0x6d9d6122,
  1735. !       0xfde5380c, 0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70,
  1736. !       0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x4881d05,  0xd9d4d039,
  1737. !       0xe6db99e5, 0x1fa27cf8, 0xc4ac5665, 0xf4292244, 0x432aff97,
  1738. !       0xab9423a7, 0xfc93a039, 0x655b59c3, 0x8f0ccc92, 0xffeff47d,
  1739. !       0x85845dd1, 0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1,
  1740. !       0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391,
  1741.       };
  1742.   
  1743.     register int
  1744. Common subdirectories: ImageMagick/utilities and ImageMagick2.2.3/utilities
  1745. Common subdirectories: ImageMagick/xtp and ImageMagick2.2.3/xtp
  1746. diff -r -c ImageMagick/utilities/MIFFtoSTEREO.c ImageMagick2.2.3/utilities/MIFFtoSTEREO.c
  1747. *** ImageMagick/utilities/MIFFtoSTEREO.c    Tue Dec 22 16:05:22 1992
  1748. --- ImageMagick2.2.3/utilities/MIFFtoSTEREO.c    Wed Dec 23 18:10:10 1992
  1749. ***************
  1750. *** 200,206 ****
  1751.       (void) fprintf(stderr," DirectClass ");
  1752.     else
  1753.       (void) fprintf(stderr," PseudoClass ");
  1754. !   (void) fprintf(stderr,"%dc %s %ds\n",stereo_image->colors,
  1755.       stereo_image->magick,time((time_t *) 0)-start_time+1);
  1756.     return(!status);
  1757.   }
  1758. --- 200,206 ----
  1759.       (void) fprintf(stderr," DirectClass ");
  1760.     else
  1761.       (void) fprintf(stderr," PseudoClass ");
  1762. !   (void) fprintf(stderr,"%dc %s %lds\n",stereo_image->colors,
  1763.       stereo_image->magick,time((time_t *) 0)-start_time+1);
  1764.     return(!status);
  1765.   }
  1766. diff -r -c ImageMagick/utilities/convert.c ImageMagick2.2.3/utilities/convert.c
  1767. *** ImageMagick/utilities/convert.c    Tue Dec 22 16:05:23 1992
  1768. --- ImageMagick2.2.3/utilities/convert.c    Wed Dec 23 18:10:10 1992
  1769. ***************
  1770. *** 203,209 ****
  1771.   char
  1772.     *argv[];
  1773.   {
  1774. ! #define NotInitialized  (~0)
  1775.   
  1776.     AlienInfo
  1777.       alien_info;
  1778. --- 203,209 ----
  1779.   char
  1780.     *argv[];
  1781.   {
  1782. ! #define NotInitialized  (unsigned int) (~0)
  1783.   
  1784.     AlienInfo
  1785.       alien_info;
  1786. ***************
  1787. *** 212,217 ****
  1788. --- 212,221 ----
  1789.       *filename,
  1790.       *option;
  1791.   
  1792. +   double
  1793. +     normalized_maximum_error,
  1794. +     normalized_mean_error;
  1795.     Image
  1796.       *image,
  1797.       *next_image;
  1798. ***************
  1799. *** 229,241 ****
  1800.       colorspace,
  1801.       compression,
  1802.       dither,
  1803.       number_colors,
  1804.       quality,
  1805.       scene,
  1806. -     total_colors,
  1807.       tree_depth,
  1808.       verbose;
  1809.   
  1810.     /*
  1811.       Initialize program variables.
  1812.     */
  1813. --- 233,248 ----
  1814.       colorspace,
  1815.       compression,
  1816.       dither,
  1817. +     mean_error_per_pixel,
  1818.       number_colors,
  1819.       quality,
  1820.       scene,
  1821.       tree_depth,
  1822.       verbose;
  1823.   
  1824. +   unsigned long int
  1825. +     total_colors;
  1826.     /*
  1827.       Initialize program variables.
  1828.     */
  1829. ***************
  1830. *** 453,483 ****
  1831.     */
  1832.     do
  1833.     {
  1834.       if (alpha != NotInitialized)
  1835.         image->alpha=alpha;
  1836.       if (compression != UndefinedCompression)
  1837.         image->compression=compression;
  1838. !     if (quality > 0)
  1839.         image->quality=quality;
  1840. !     if (scene > 0)
  1841.         image->scene=scene;
  1842.       (void) strcpy(image->filename,argv[i]);
  1843.       if (image->last != (Image *) NULL)
  1844.         (void) sprintf(image->filename,"%s.%u\0",argv[i],image->scene);
  1845. -     if (verbose)
  1846. -       {
  1847. -         /*
  1848. -           Initialize image error attributes.
  1849. -         */
  1850. -         if (image->class == DirectClass)
  1851. -           image->colors=NumberColors(image,(FILE *) NULL);
  1852. -         total_colors=image->colors;
  1853. -       }
  1854.       if (colorspace == GRAYColorspace)
  1855.         QuantizeImage(image,256,8,dither,GRAYColorspace,True);
  1856. !     if (number_colors > 0)
  1857.         if ((image->class == DirectClass) || (image->colors > number_colors))
  1858. !         QuantizeImage(image,number_colors,tree_depth,dither,colorspace,True);
  1859.       status=WriteAlienImage(image);
  1860.       if (verbose)
  1861.         {
  1862. --- 460,497 ----
  1863.     */
  1864.     do
  1865.     {
  1866. +     total_colors=0;
  1867.       if (alpha != NotInitialized)
  1868.         image->alpha=alpha;
  1869.       if (compression != UndefinedCompression)
  1870.         image->compression=compression;
  1871. !     if (quality != 0)
  1872.         image->quality=quality;
  1873. !     if (scene != 0)
  1874.         image->scene=scene;
  1875.       (void) strcpy(image->filename,argv[i]);
  1876.       if (image->last != (Image *) NULL)
  1877.         (void) sprintf(image->filename,"%s.%u\0",argv[i],image->scene);
  1878.       if (colorspace == GRAYColorspace)
  1879.         QuantizeImage(image,256,8,dither,GRAYColorspace,True);
  1880. !     if (number_colors != 0)
  1881.         if ((image->class == DirectClass) || (image->colors > number_colors))
  1882. !         {
  1883. !           /*
  1884. !             Reduce the number of colors in the image.
  1885. !           */
  1886. !           QuantizeImage(image,number_colors,tree_depth,dither,colorspace,True);
  1887. !           if (verbose)
  1888. !             {
  1889. !               /*
  1890. !                 Measure quantization error.
  1891. !               */
  1892. !               QuantizationError(image,&mean_error_per_pixel,
  1893. !                 &normalized_mean_error,&normalized_maximum_error);
  1894. !               total_colors=NumberColors(image,(FILE *) NULL);
  1895. !             }
  1896. !           SyncImage(image);
  1897. !         }
  1898.       status=WriteAlienImage(image);
  1899.       if (verbose)
  1900.         {
  1901. ***************
  1902. *** 490,512 ****
  1903.             (void) fprintf(stderr," DirectClass ");
  1904.           else
  1905.             (void) fprintf(stderr," PseudoClass ");
  1906. !         if (total_colors != image->colors)
  1907. !           (void) fprintf(stderr,"%u=>",total_colors);
  1908. !         (void) fprintf(stderr,"%uc",image->colors);
  1909. !         if (number_colors > 0)
  1910.             {
  1911. !             double
  1912. !               normalized_maximum_error,
  1913. !               normalized_mean_error;
  1914. !             unsigned int
  1915. !               mean_error_per_pixel;
  1916. !             /*
  1917. !               Measure quantization error.
  1918. !             */
  1919. !             QuantizationError(image,&mean_error_per_pixel,
  1920. !               &normalized_mean_error,&normalized_maximum_error);
  1921.               (void) fprintf(stderr," %u/%.6f/%.6fe",mean_error_per_pixel,
  1922.                 normalized_mean_error,normalized_maximum_error);
  1923.             }
  1924. --- 504,514 ----
  1925.             (void) fprintf(stderr," DirectClass ");
  1926.           else
  1927.             (void) fprintf(stderr," PseudoClass ");
  1928. !         if (total_colors == 0)
  1929. !           (void) fprintf(stderr,"%uc",image->colors);
  1930. !         else
  1931.             {
  1932. !             (void) fprintf(stderr,"%lu=>%uc",total_colors,image->colors);
  1933.               (void) fprintf(stderr," %u/%.6f/%.6fe",mean_error_per_pixel,
  1934.                 normalized_mean_error,normalized_maximum_error);
  1935.             }
  1936. diff -r -c ImageMagick/utilities/mogrify.c ImageMagick2.2.3/utilities/mogrify.c
  1937. *** ImageMagick/utilities/mogrify.c    Tue Dec 22 16:05:24 1992
  1938. --- ImageMagick2.2.3/utilities/mogrify.c    Wed Dec 23 18:10:10 1992
  1939. ***************
  1940. *** 629,634 ****
  1941. --- 629,638 ----
  1942.         }
  1943.       else
  1944.         {
  1945. +         double
  1946. +           normalized_maximum_error,
  1947. +           normalized_mean_error;
  1948.           Image
  1949.             *image,
  1950.             info_image,
  1951. ***************
  1952. *** 637,642 ****
  1953. --- 641,649 ----
  1954.           time_t
  1955.             start_time;
  1956.   
  1957. +         unsigned int
  1958. +           mean_error_per_pixel;
  1959.           unsigned long
  1960.             total_colors;
  1961.   
  1962. ***************
  1963. *** 656,661 ****
  1964. --- 663,669 ----
  1965.             info_image=(*image);
  1966.             if (scene > 0)
  1967.               image->scene=scene;
  1968. +           total_colors=0;
  1969.             /*
  1970.               Transform image as defined by the clip, image and scale geometries.
  1971.             */
  1972. ***************
  1973. *** 796,810 ****
  1974.               InverseImage(image);
  1975.             if (normalize)
  1976.               NormalizeImage(image);
  1977. -           if (verbose)
  1978. -             {
  1979. -               /*
  1980. -                 Initialize image error attributes.
  1981. -               */
  1982. -               if (image->class == DirectClass)
  1983. -                 image->colors=NumberColors(image,(FILE *) NULL);
  1984. -               total_colors=image->colors;
  1985. -             }
  1986.             if (colorspace == GRAYColorspace)
  1987.               QuantizeImage(image,256,8,dither,GRAYColorspace,True);
  1988.             if (monochrome)
  1989. --- 804,809 ----
  1990. ***************
  1991. *** 812,819 ****
  1992.             if (number_colors > 0)
  1993.               if ((image->class == DirectClass) ||
  1994.                   (image->colors > number_colors))
  1995. !               QuantizeImage(image,number_colors,tree_depth,dither,colorspace,
  1996. !                 True);
  1997.             if (verbose)
  1998.               {
  1999.                 /*
  2000. --- 811,833 ----
  2001.             if (number_colors > 0)
  2002.               if ((image->class == DirectClass) ||
  2003.                   (image->colors > number_colors))
  2004. !               {
  2005. !                 /*
  2006. !                   Reduce the number of colors in the image.
  2007. !                 */
  2008. !                 QuantizeImage(image,number_colors,tree_depth,dither,colorspace,
  2009. !                   True);
  2010. !                 if (verbose)
  2011. !                   {
  2012. !                     /*
  2013. !                       Measure quantization error.
  2014. !                     */
  2015. !                     QuantizationError(image,&mean_error_per_pixel,
  2016. !                       &normalized_mean_error,&normalized_maximum_error);
  2017. !                     total_colors=NumberColors(image,(FILE *) NULL);
  2018. !                   }
  2019. !                 SyncImage(image);
  2020. !               }
  2021.             if (verbose)
  2022.               {
  2023.                 /*
  2024. ***************
  2025. *** 831,853 ****
  2026.                   (void) fprintf(stderr," DirectClass ");
  2027.                 else
  2028.                   (void) fprintf(stderr," PseudoClass ");
  2029. !               if (total_colors != image->colors)
  2030. !                 (void) fprintf(stderr,"%lu=>",total_colors);
  2031. !               (void) fprintf(stderr,"%uc",image->colors);
  2032. !               if ((number_colors > 0) || monochrome)
  2033.                   {
  2034. !                   double
  2035. !                     normalized_maximum_error,
  2036. !                     normalized_mean_error;
  2037. !                   unsigned int
  2038. !                     mean_error_per_pixel;
  2039. !                   /*
  2040. !                     Measure quantization error.
  2041. !                   */
  2042. !                   QuantizationError(image,&mean_error_per_pixel,
  2043. !                     &normalized_mean_error,&normalized_maximum_error);
  2044.                     (void) fprintf(stderr," %u/%.6f/%.6fe",mean_error_per_pixel,
  2045.                       normalized_mean_error,normalized_maximum_error);
  2046.                   }
  2047. --- 845,855 ----
  2048.                   (void) fprintf(stderr," DirectClass ");
  2049.                 else
  2050.                   (void) fprintf(stderr," PseudoClass ");
  2051. !               if (total_colors == 0)
  2052. !                 (void) fprintf(stderr,"%uc",image->colors);
  2053. !               else
  2054.                   {
  2055. !                   (void) fprintf(stderr,"%lu=>%uc",total_colors,image->colors);
  2056.                     (void) fprintf(stderr," %u/%.6f/%.6fe",mean_error_per_pixel,
  2057.                       normalized_mean_error,normalized_maximum_error);
  2058.                   }
  2059. diff -r -c ImageMagick/xtp/xtp.c ImageMagick2.2.3/xtp/xtp.c
  2060. *** ImageMagick/xtp/xtp.c    Tue Dec 22 16:05:32 1992
  2061. --- ImageMagick2.2.3/xtp/xtp.c    Wed Dec 23 21:12:13 1992
  2062. ***************
  2063. *** 313,319 ****
  2064.     (void) tcgetattr(STDIN_FILENO,&attributes);
  2065.     attributes.c_lflag&=(~ECHO);
  2066.     (void) tcsetattr(STDIN_FILENO,TCSANOW,&attributes);
  2067. !   gets(password);
  2068.     attributes.c_lflag|=ECHO;
  2069.     (void) tcsetattr(STDIN_FILENO,TCSANOW,&attributes);
  2070.     (void) fprintf(stdout,"\n");
  2071. --- 313,319 ----
  2072.     (void) tcgetattr(STDIN_FILENO,&attributes);
  2073.     attributes.c_lflag&=(~ECHO);
  2074.     (void) tcsetattr(STDIN_FILENO,TCSANOW,&attributes);
  2075. !   (void) gets(password);
  2076.     attributes.c_lflag|=ECHO;
  2077.     (void) tcsetattr(STDIN_FILENO,TCSANOW,&attributes);
  2078.     (void) fprintf(stdout,"\n");
  2079. -- 
  2080. cristy@dupont.com
  2081.  
  2082. exit 0 # Just in case...
  2083.