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

  1. Newsgroups: comp.sources.misc
  2. From: cristy@eplrx7.es.duPont.com (John Cristy)
  3. Subject: v34i085: imagemagick - X11 image processing and display v2.2, Patch01a/3
  4. Message-ID: <1992Dec27.225823.369@sparky.imd.sterling.com>
  5. X-Md4-Signature: bf733655c1252697e4d08c00f8c1f042
  6. Date: Sun, 27 Dec 1992 22:58:23 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 85
  11. Archive-name: imagemagick/patch01a
  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 #1
  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.     cd ImageMagick
  24.     mv rotate.c shear.c
  25.  
  26. Prereq: ImageMagick 2.2 (posted from comp.sources.misc, Volume 34,
  27. Issue 28).
  28.  
  29. Alternatively get the entire distribution as contrib/ImageMagick.tar.Z
  30. on export.lcs.mit.edu.
  31.  
  32. -----------
  33. #!/bin/sh
  34. # This is ImageMagick/patch01, a shell archive (produced by shar 3.49)
  35. # To extract the files from this archive, save it to a file, remove
  36. # everything above the "!/bin/sh" line above, and type "sh file_name".
  37. #
  38. # made 12/21/1992 19:38 UTC by cristy@dupont.com
  39. # Source directory /tmp_mnt/nfs/zeta/home/cristy/Archive/ImageMagick
  40. #
  41. # existing files will NOT be overwritten unless -c is specified
  42. #
  43. # This is part 1 of a multipart archive                                    
  44. # do not concatenate these parts, unpack them in order with /bin/sh        
  45. #
  46. # This shar contains:
  47. # length  mode       name
  48. # ------ ---------- ------------------------------------------
  49. # 192393 -rw------- fix-01
  50. #
  51. if test -r _shar_seq_.tmp; then
  52.     echo 'Must unpack archives in sequence!'
  53.     echo Please unpack part `cat _shar_seq_.tmp` next
  54.     exit 1
  55. fi
  56. # ============= fix-01 ==============
  57. if test -f 'fix-01' -a X"$1" != X"-c"; then
  58.     echo 'x - skipping fix-01 (File already exists)'
  59.     rm -f _shar_wnt_.tmp
  60. else
  61. > _shar_wnt_.tmp
  62. echo 'x - extracting fix-01 (Text)'
  63. sed 's/^X//' << 'SHAR_EOF' > 'fix-01' &&
  64. diff -r -c ImageMagick/ChangeLog ImageMagick2.2.1/ChangeLog
  65. *** ImageMagick/ChangeLog    Wed Dec  2 09:33:26 1992
  66. --- ImageMagick2.2.1/ChangeLog    Mon Dec 21 14:12:35 1992
  67. ***************
  68. *** 1,3 ****
  69. --- 1,35 ----
  70. + ImageMagick 2.2.1
  71. +   o The number of colors reported with the -verbose option was on
  72. +     occasion incorrect.
  73. +   o Color quantization was improved and in some cases sped up ~10%.
  74. +   o Cleaned up image rotation code.
  75. +   o Added -shear to mogrify options.
  76. +   o Added a file type of HISTOGRAM to convert.
  77. +   o Sometimes PBM image files did not have the correct number of bytes.
  78. +   o Color reduced PPM images were being written at the full color resolution.
  79. +   o Keypresses are no longer accepted during image configuration.
  80. +   o Red, green, and blue values of a X constant image were set to the
  81. +     red intensity of the background color.
  82. +   o Clipped images did not show up correctly in the panning icon.
  83. +   o `animate' no longer shows images out-of-order if the image scene number is
  84. +     absent (thanks to kent@oddjob.uchicago.edu).
  85. +   o ImageMagick now recognizes the X resource class with the first letter
  86. +     of the client capitalized, i.e. 'Display.Visual: default' (thanks to
  87. +     dws@ssec.wisc.edu).
  88. X  ImageMagick 2.2
  89. X  
  90. X    o When displaying a composite MIFF image created with `montage',
  91. ***************
  92. *** 17,22 ****
  93. --- 49,57 ----
  94. X    o Updated MIFF manual page to reflect 'montage' image header
  95. X      keyword.
  96. X  
  97. +   o Add -colormap to `mogrify.'  Use to color reduce an image to
  98. +     a set of colors you choose.
  99. X    o Some compilers have read-only strings.   ImageMagick no longer
  100. X      writes on read-only strings.
  101. X  
  102. ***************
  103. *** 57,64 ****
  104. X    o Panning uses a pixmap for faster panning speed.
  105. X  
  106. X    o Rotate.c now uses a table to force range limits.
  107. -   o Fixed strcasecmp to work under VMS.
  108. X  
  109. X    o range table in quantize.c is allocated from the heap instead of
  110. X      the stack.
  111. --- 92,97 ----
  112. diff -r -c ImageMagick/Imakefile ImageMagick2.2.1/Imakefile
  113. *** ImageMagick/Imakefile    Wed Nov 25 14:22:24 1992
  114. --- ImageMagick2.2.1/Imakefile    Fri Dec 18 17:07:44 1992
  115. ***************
  116. *** 25,34 ****
  117. X  
  118. X  #include "Magick.tmpl"
  119. X  
  120. ! MagickObjects= X.o image.o rotate.o quantize.o colors.o signature.o compress.o\
  121. X    alien.o PreRvIcccm.o
  122. X  
  123. ! SRCS= display.c X.c image.c rotate.c quantize.c colors.c signature.c\
  124. X    compress.c alien.c PreRvIcccm.c
  125. X  OBJS= display.o $(MagickObjects)
  126. X  AnimateObjects= animate.o $(MagickObjects)
  127. --- 25,34 ----
  128. X  
  129. X  #include "Magick.tmpl"
  130. X  
  131. ! MagickObjects= X.o image.o shear.o quantize.o colors.o signature.o compress.o\
  132. X    alien.o PreRvIcccm.o
  133. X  
  134. ! SRCS= display.c X.c image.c shear.c quantize.c colors.c signature.c\
  135. X    compress.c alien.c PreRvIcccm.c
  136. X  OBJS= display.o $(MagickObjects)
  137. X  AnimateObjects= animate.o $(MagickObjects)
  138. diff -r -c ImageMagick/Make.com ImageMagick2.2.1/Make.com
  139. *** ImageMagick/Make.com    Wed Jun 24 10:40:27 1992
  140. --- ImageMagick2.2.1/Make.com    Fri Dec 18 17:08:13 1992
  141. ***************
  142. *** 12,18 ****
  143. X  $call Make display
  144. X  $call Make X
  145. X  $call Make image
  146. ! $call Make rotate
  147. X  $call Make quantize
  148. X  $call Make colors
  149. X  $call Make signature
  150. --- 12,18 ----
  151. X  $call Make display
  152. X  $call Make X
  153. X  $call Make image
  154. ! $call Make shear
  155. X  $call Make quantize
  156. X  $call Make colors
  157. X  $call Make signature
  158. ***************
  159. *** 20,26 ****
  160. X  $call Make alien
  161. X  $call Make PreRvIcccm
  162. X  $
  163. ! $link'link_options' display,X,image,rotate,quantize,colors,signature, -
  164. X    compress,alien,PreRvIcccm,sys$input:/opt
  165. X  sys$share:decw$xlibshr.exe/share
  166. X  $
  167. --- 20,26 ----
  168. X  $call Make alien
  169. X  $call Make PreRvIcccm
  170. X  $
  171. ! $link'link_options' display,X,image,shear,quantize,colors,signature, -
  172. X    compress,alien,PreRvIcccm,sys$input:/opt
  173. X  sys$share:decw$xlibshr.exe/share
  174. X  $
  175. ***************
  176. *** 33,39 ****
  177. X  $call Make import
  178. X  $call Make X
  179. X  $call Make image
  180. ! $call Make rotate
  181. X  $call Make quantize
  182. X  $call Make colors
  183. X  $call Make signature
  184. --- 33,39 ----
  185. X  $call Make import
  186. X  $call Make X
  187. X  $call Make image
  188. ! $call Make shear
  189. X  $call Make quantize
  190. X  $call Make colors
  191. X  $call Make signature
  192. ***************
  193. *** 41,47 ****
  194. X  $call Make alien
  195. X  $call Make PreRvIcccm
  196. X  $
  197. ! $link'link_options' import,X,image,rotate,quantize,colors,signature,compress, -
  198. X    alien,PreRvIcccm,sys$input:/opt
  199. X  sys$share:decw$xlibshr.exe/share
  200. X  $
  201. --- 41,47 ----
  202. X  $call Make alien
  203. X  $call Make PreRvIcccm
  204. X  $
  205. ! $link'link_options' import,X,image,shear,quantize,colors,signature,compress, -
  206. X    alien,PreRvIcccm,sys$input:/opt
  207. X  sys$share:decw$xlibshr.exe/share
  208. X  $
  209. ***************
  210. *** 54,60 ****
  211. X  $call Make XtoPS
  212. X  $call Make X
  213. X  $call Make image
  214. ! $call Make rotate
  215. X  $call Make quantize
  216. X  $call Make colors
  217. X  $call Make signature
  218. --- 54,60 ----
  219. X  $call Make XtoPS
  220. X  $call Make X
  221. X  $call Make image
  222. ! $call Make shear
  223. X  $call Make quantize
  224. X  $call Make colors
  225. X  $call Make signature
  226. ***************
  227. *** 61,67 ****
  228. X  $call Make compress
  229. X  $call Make PreRvIcccm
  230. X  $
  231. ! $link'link_options' XtoPS,X,image,rotate,quantize,colors,signature,compress, -
  232. X    alien,PreRvIcccm,sys$input:/opt
  233. X  sys$share:decw$xlibshr.exe/share
  234. X  $
  235. --- 61,67 ----
  236. X  $call Make compress
  237. X  $call Make PreRvIcccm
  238. X  $
  239. ! $link'link_options' XtoPS,X,image,shear,quantize,colors,signature,compress, -
  240. X    alien,PreRvIcccm,sys$input:/opt
  241. X  sys$share:decw$xlibshr.exe/share
  242. X  $
  243. ***************
  244. *** 74,80 ****
  245. X  $call Make animate
  246. X  $call Make X
  247. X  $call Make image
  248. ! $call Make rotate
  249. X  $call Make quantize
  250. X  $call Make colors
  251. X  $call Make signature
  252. --- 74,80 ----
  253. X  $call Make animate
  254. X  $call Make X
  255. X  $call Make image
  256. ! $call Make shear
  257. X  $call Make quantize
  258. X  $call Make colors
  259. X  $call Make signature
  260. ***************
  261. *** 82,88 ****
  262. X  $call Make alien
  263. X  $call Make PreRvIcccm
  264. X  $
  265. ! $link'link_options' animate,X,image,rotate,quantize,colors,signature, -
  266. X    compress,alien,PreRvIcccm,sys$input:/opt
  267. X  sys$share:decw$xlibshr.exe/share
  268. X  $
  269. --- 82,88 ----
  270. X  $call Make alien
  271. X  $call Make PreRvIcccm
  272. X  $
  273. ! $link'link_options' animate,X,image,shear,quantize,colors,signature, -
  274. X    compress,alien,PreRvIcccm,sys$input:/opt
  275. X  sys$share:decw$xlibshr.exe/share
  276. X  $
  277. ***************
  278. *** 95,101 ****
  279. X  $call Make montage
  280. X  $call Make X
  281. X  $call Make image
  282. ! $call Make rotate
  283. X  $call Make quantize
  284. X  $call Make colors
  285. X  $call Make compress
  286. --- 95,101 ----
  287. X  $call Make montage
  288. X  $call Make X
  289. X  $call Make image
  290. ! $call Make shear
  291. X  $call Make quantize
  292. X  $call Make colors
  293. X  $call Make compress
  294. ***************
  295. *** 102,108 ****
  296. X  $call Make alien
  297. X  $call Make PreRvIcccm
  298. X  $
  299. ! $link'link_options' montage,X,image,rotate,quantize,colors,signature, -
  300. X    compress,alien,PreRvIcccm,sys$input:/opt
  301. X  sys$share:decw$xlibshr.exe/share
  302. X  $
  303. --- 102,108 ----
  304. X  $call Make alien
  305. X  $call Make PreRvIcccm
  306. X  $
  307. ! $link'link_options' montage,X,image,shear,quantize,colors,signature, -
  308. X    compress,alien,PreRvIcccm,sys$input:/opt
  309. X  sys$share:decw$xlibshr.exe/share
  310. X  $
  311. diff -r -c ImageMagick/Makefile ImageMagick2.2.1/Makefile
  312. *** ImageMagick/Makefile    Thu Jun 11 21:45:51 1992
  313. --- ImageMagick2.2.1/Makefile    Fri Dec 18 17:08:13 1992
  314. ***************
  315. *** 45,51 ****
  316. X  DEFINES= $(JPEG) $(JPEG_INCLUDES) $(TIFF) $(TIFF_INCLUDES)
  317. X  SYS_LIBRARIES= $(XLIB) $(JPEG_LIBRARIES) $(TIFF_LIBRARIES) -lm
  318. X  
  319. ! MagickObjects= X.o image.o rotate.o quantize.o colors.o signature.o compress.o\
  320. X    alien.o PreRvIcccm.o
  321. X  
  322. X  DisplayObjects= display.o $(MagickObjects)
  323. --- 45,51 ----
  324. X  DEFINES= $(JPEG) $(JPEG_INCLUDES) $(TIFF) $(TIFF_INCLUDES)
  325. X  SYS_LIBRARIES= $(XLIB) $(JPEG_LIBRARIES) $(TIFF_LIBRARIES) -lm
  326. X  
  327. ! MagickObjects= X.o image.o shear.o quantize.o colors.o signature.o compress.o\
  328. X    alien.o PreRvIcccm.o
  329. X  
  330. X  DisplayObjects= display.o $(MagickObjects)
  331. diff -r -c ImageMagick/Manifest.ps ImageMagick2.2.1/Manifest.ps
  332. *** ImageMagick/Manifest.ps    Wed Nov 25 14:23:10 1992
  333. --- ImageMagick2.2.1/Manifest.ps    Fri Dec 18 17:09:13 1992
  334. ***************
  335. *** 52,65 ****
  336. X  90 362 m(montage.man)s
  337. X  90 352 m(quantize.c)s
  338. X  90 342 m(quantize.man)s
  339. ! 90 332 m(rotate.c)s
  340. ! 180 322 m(Makefile)s
  341. ! 180 312 m(README)s
  342. ! 180 302 m(dna.script)s
  343. ! 90 312 m(scenes)s
  344. ! (scenes) stringwidth pop 91.0 add 315.3 m
  345. ! [ 325.3 315.3 305.3]
  346. X  {gsave 176.0 exch lineto stroke grestore} forall
  347. X  90 292 m(signature.c)s
  348. X  180 282 m(Imakefile)s
  349. X  180 272 m(MIFFtoSTEREO.c)s
  350. --- 52,65 ----
  351. X  90 362 m(montage.man)s
  352. X  90 352 m(quantize.c)s
  353. X  90 342 m(quantize.man)s
  354. ! 180 332 m(Makefile)s
  355. ! 180 322 m(README)s
  356. ! 180 312 m(dna.script)s
  357. ! 90 322 m(scenes)s
  358. ! (scenes) stringwidth pop 91.0 add 325.3 m
  359. ! [ 335.3 325.3 315.3]
  360. X  {gsave 176.0 exch lineto stroke grestore} forall
  361. + 90 302 m(shear.c)s
  362. X  90 292 m(signature.c)s
  363. X  180 282 m(Imakefile)s
  364. X  180 272 m(MIFFtoSTEREO.c)s
  365. ***************
  366. *** 89,94 ****
  367. X  {gsave 176.0 exch lineto stroke grestore} forall
  368. X  0 444 m(ImageMagick)s
  369. X  (ImageMagick) stringwidth pop 1.0 add 447.8 m
  370. ! [ 735.3 725.3 715.3 705.3 695.3 685.3 675.3 665.3 655.3 645.3 635.3 625.3 615.3 605.3 595.3 585.3 575.3 565.3 555.3 545.3 535.3 525.3 515.3 505.3 495.3 485.3 475.3 465.3 435.3 405.3 395.3 385.3 375.3 365.3 355.3 345.3 335.3 315.3 295.3 250.3 160.3]
  371. X  {gsave 86.0 exch lineto stroke grestore} forall
  372. X  showpage
  373. --- 89,94 ----
  374. X  {gsave 176.0 exch lineto stroke grestore} forall
  375. X  0 444 m(ImageMagick)s
  376. X  (ImageMagick) stringwidth pop 1.0 add 447.8 m
  377. ! [ 735.3 725.3 715.3 705.3 695.3 685.3 675.3 665.3 655.3 645.3 635.3 625.3 615.3 605.3 595.3 585.3 575.3 565.3 555.3 545.3 535.3 525.3 515.3 505.3 495.3 485.3 475.3 465.3 435.3 405.3 395.3 385.3 375.3 365.3 355.3 345.3 325.3 305.3 295.3 250.3 160.3]
  378. X  {gsave 86.0 exch lineto stroke grestore} forall
  379. X  showpage
  380. diff -r -c ImageMagick/README ImageMagick2.2.1/README
  381. *** ImageMagick/README    Thu Dec 10 15:16:54 1992
  382. --- ImageMagick2.2.1/README    Fri Dec 18 17:10:28 1992
  383. ***************
  384. *** 234,239 ****
  385. --- 234,244 ----
  386. X  
  387. X          Illegal unit size: 8 found in routine: _normalizeimagebits
  388. X  
  389. +       If alien.c does not compile on your HP, type defining
  390. +       -DXLIB_ILLEGAL_ACCESS when compiling.  If `display' dumps core
  391. +       when exiting, remove XCloseDisplay near the last line of
  392. +       display.c.
  393. X    4.  On occasion, a window manager (twm) may get in strange state which will 
  394. X        cause the display program to work improperly.  Fix this by restarting the
  395. X        window manager.
  396. diff -r -c ImageMagick/X.c ImageMagick2.2.1/X.c
  397. *** ImageMagick/X.c    Mon Dec  7 17:23:19 1992
  398. --- ImageMagick2.2.1/X.c    Mon Dec 21 14:12:34 1992
  399. ***************
  400. *** 62,68 ****
  401. X    External declarations.
  402. X  */
  403. X  extern char
  404. !   *application_name;
  405. X  
  406. X  extern void
  407. X    Error _Declare((char *,char *));
  408. --- 62,68 ----
  409. X    External declarations.
  410. X  */
  411. X  extern char
  412. !   *client_name;
  413. X  
  414. X  extern void
  415. X    Error _Declare((char *,char *));
  416. ***************
  417. *** 136,144 ****
  418. X  %  greater than, equal to, or less than second.  The two strings are
  419. X  %  assumed to be encoded using ISO 8859-1.
  420. X  %
  421. ! %  The format of the Latin1Upper routine is:
  422. X  %
  423. ! %      Latin1Upper(first,second)
  424. X  %
  425. X  %  A description of each parameter follows:
  426. X  %
  427. --- 136,144 ----
  428. X  %  greater than, equal to, or less than second.  The two strings are
  429. X  %  assumed to be encoded using ISO 8859-1.
  430. X  %
  431. ! %  The format of the Latin1Compare routine is:
  432. X  %
  433. ! %      Latin1Compare(first,second)
  434. X  %
  435. X  %  A description of each parameter follows:
  436. X  %
  437. ***************
  438. *** 386,392 ****
  439. X    /*
  440. X      Get user defaults from X resource database.
  441. X    */
  442. !   XGetResourceInfo(resource_database,application_name,&resource_info);
  443. X    /*
  444. X      Initialize visual info.
  445. X    */
  446. --- 386,392 ----
  447. X    /*
  448. X      Get user defaults from X resource database.
  449. X    */
  450. !   XGetResourceInfo(resource_database,client_name,&resource_info);
  451. X    /*
  452. X      Initialize visual info.
  453. X    */
  454. ***************
  455. *** 1117,1123 ****
  456. X    /*
  457. X      Get user defaults from X resource database.
  458. X    */
  459. !   XGetResourceInfo(resource_database,application_name,&resource_info);
  460. X    /*
  461. X      Initialize visual info.
  462. X    */
  463. --- 1117,1123 ----
  464. X    /*
  465. X      Get user defaults from X resource database.
  466. X    */
  467. !   XGetResourceInfo(resource_database,client_name,&resource_info);
  468. X    /*
  469. X      Initialize visual info.
  470. X    */
  471. ***************
  472. *** 1129,1135 ****
  473. X        return((Image *) NULL);
  474. X      }
  475. X    /*
  476. !     Determine background foreground colors.
  477. X    */
  478. X    map_info.colormap=XDefaultColormap(display,visual_info->screen);
  479. X    XGetPixelInfo(display,visual_info,&map_info,&resource_info,(Image *) NULL,
  480. --- 1129,1135 ----
  481. X        return((Image *) NULL);
  482. X      }
  483. X    /*
  484. !     Determine border color.
  485. X    */
  486. X    map_info.colormap=XDefaultColormap(display,visual_info->screen);
  487. X    XGetPixelInfo(display,visual_info,&map_info,&resource_info,(Image *) NULL,
  488. ***************
  489. *** 1167,1175 ****
  490. X        DestroyImage(image);
  491. X        return((Image *) NULL);
  492. X      }
  493. !   image->colormap[0].red=pixel_info.background_color.red >> 8;
  494. !   image->colormap[0].green=pixel_info.background_color.red >> 8;
  495. !   image->colormap[0].blue=pixel_info.background_color.red >> 8;
  496. X    p=image->pixels;
  497. X    for (i=0; i < (image->columns*image->rows); i++)
  498. X    {
  499. --- 1167,1175 ----
  500. X        DestroyImage(image);
  501. X        return((Image *) NULL);
  502. X      }
  503. !   image->colormap[0].red=pixel_info.border_color.red >> 8;
  504. !   image->colormap[0].green=pixel_info.border_color.green >> 8;
  505. !   image->colormap[0].blue=pixel_info.border_color.blue >> 8;
  506. X    p=image->pixels;
  507. X    for (i=0; i < (image->columns*image->rows); i++)
  508. X    {
  509. ***************
  510. *** 1372,1379 ****
  511. X    */
  512. X    (void) XParseGeometry(annotate_info->geometry,&x,&y,&width,&height);
  513. X    if ((width != annotate_image->columns) || (height != annotate_image->rows))
  514. !     TransformImage(&annotate_image,(char *) NULL,
  515. !       annotate_info->geometry,(char *) NULL);
  516. X    if (annotate_info->degrees != 0.0)
  517. X      {
  518. X        Image
  519. --- 1372,1379 ----
  520. X    */
  521. X    (void) XParseGeometry(annotate_info->geometry,&x,&y,&width,&height);
  522. X    if ((width != annotate_image->columns) || (height != annotate_image->rows))
  523. !     TransformImage(&annotate_image,(char *) NULL,annotate_info->geometry,
  524. !       (char *) NULL);
  525. X    if (annotate_info->degrees != 0.0)
  526. X      {
  527. X        Image
  528. ***************
  529. *** 1576,1586 ****
  530. X  #define MaxIconSize  64
  531. X  
  532. X    int
  533. X      number_sizes;
  534. X  
  535. X    unsigned int
  536. X      icon_height,
  537. !     icon_width;
  538. X  
  539. X    unsigned long int
  540. X      scale_factor;
  541. --- 1576,1589 ----
  542. X  #define MaxIconSize  64
  543. X  
  544. X    int
  545. +     i,
  546. X      number_sizes;
  547. X  
  548. X    unsigned int
  549. +     height,
  550. X      icon_height,
  551. !     icon_width,
  552. !     width;
  553. X  
  554. X    unsigned long int
  555. X      scale_factor;
  556. ***************
  557. *** 1622,1636 ****
  558. X        icon_size->height_inc=1;
  559. X      }
  560. X    /*
  561. X      Look for an icon size that maintains the aspect ratio of image.
  562. X    */
  563. !   scale_factor=UpShift(icon_size->max_width)/image->columns;
  564. !   if (scale_factor > (UpShift(icon_size->max_height)/image->rows))
  565. !     scale_factor=UpShift(icon_size->max_height)/image->rows;
  566. X    icon_width=icon_size->min_width;
  567. X    while (icon_width < icon_size->max_width)
  568. X    {
  569. !     if (icon_width >= (DownShift(image->columns*scale_factor)))
  570. X        break;
  571. X      icon_width+=icon_size->width_inc;
  572. X    }
  573. --- 1625,1646 ----
  574. X        icon_size->height_inc=1;
  575. X      }
  576. X    /*
  577. +     Determine aspect ratio of image.
  578. +   */
  579. +   width=image->columns;
  580. +   height=image->rows;
  581. +   if (window->clip_geometry)
  582. +     (void) XParseGeometry(window->clip_geometry,&i,&i,&width,&height);
  583. +   /*
  584. X      Look for an icon size that maintains the aspect ratio of image.
  585. X    */
  586. !   scale_factor=UpShift(icon_size->max_width)/width;
  587. !   if (scale_factor > (UpShift(icon_size->max_height)/height))
  588. !     scale_factor=UpShift(icon_size->max_height)/height;
  589. X    icon_width=icon_size->min_width;
  590. X    while (icon_width < icon_size->max_width)
  591. X    {
  592. !     if (icon_width >= (DownShift(width*scale_factor)))
  593. X        break;
  594. X      icon_width+=icon_size->width_inc;
  595. X    }
  596. ***************
  597. *** 1637,1643 ****
  598. X    icon_height=icon_size->min_height;
  599. X    while (icon_height < icon_size->max_height)
  600. X    {
  601. !     if (icon_height >= (DownShift(image->rows*scale_factor)))
  602. X        break;
  603. X      icon_height+=icon_size->height_inc;
  604. X    }
  605. --- 1647,1653 ----
  606. X    icon_height=icon_size->min_height;
  607. X    while (icon_height < icon_size->max_height)
  608. X    {
  609. !     if (icon_height >= (DownShift(height*scale_factor)))
  610. X        break;
  611. X      icon_height+=icon_size->height_inc;
  612. X    }
  613. ***************
  614. *** 2352,2358 ****
  615. X  %
  616. X  %  The format of the XGetResource routine is:
  617. X  %
  618. ! %      value=XGetResource(database,application_name,name,class,resource_default)
  619. X  %
  620. X  %  A description of each parameter follows:
  621. X  %
  622. --- 2362,2368 ----
  623. X  %
  624. X  %  The format of the XGetResource routine is:
  625. X  %
  626. ! %      value=XGetResource(database,client,keyword,resource_default)
  627. X  %
  628. X  %  A description of each parameter follows:
  629. X  %
  630. ***************
  631. *** 2363,2388 ****
  632. X  %    o database: Specifies a resource database; returned from
  633. X  %      XrmGetStringDatabase.
  634. X  %
  635. ! %    o application_name:  Specifies the application name used to retrieve
  636. X  %      resource info from the X server database.
  637. X  %
  638. ! %    o name: Specifies the name of the value being retrieved.
  639. X  %
  640. - %    o class: Specifies the class of the value being retrieved.
  641. - %
  642. X  %    o resource_default: Specifies the default value to return if the query
  643. ! %      fails to find the specified name/class.
  644. X  %
  645. X  %
  646. X  */
  647. ! char *XGetResource(database,application_name,name,class,resource_default)
  648. X  XrmDatabase
  649. X    database;
  650. X  
  651. X  char
  652. !   *application_name,
  653. !   *name,
  654. !   *class,
  655. X    *resource_default;
  656. X  {
  657. X    char
  658. --- 2373,2395 ----
  659. X  %    o database: Specifies a resource database; returned from
  660. X  %      XrmGetStringDatabase.
  661. X  %
  662. ! %    o client:  Specifies the application name used to retrieve
  663. X  %      resource info from the X server database.
  664. X  %
  665. ! %    o keyword: Specifies the keyword of the value being retrieved.
  666. X  %
  667. X  %    o resource_default: Specifies the default value to return if the query
  668. ! %      fails to find the specified keyword/class.
  669. X  %
  670. X  %
  671. X  */
  672. ! char *XGetResource(database,client,keyword,resource_default)
  673. X  XrmDatabase
  674. X    database;
  675. X  
  676. X  char
  677. !   *client,
  678. !   *keyword,
  679. X    *resource_default;
  680. X  {
  681. X    char
  682. ***************
  683. *** 2399,2409 ****
  684. X    if (database == (XrmDatabase) NULL)
  685. X      return(resource_default);
  686. X    *resource_name='\0';
  687. -   if (name != (char *) NULL)
  688. -     (void) sprintf(resource_name,"%s.%s\0",application_name,name);
  689. X    *resource_class='\0';
  690. !   if (class != (char *) NULL)
  691. !     (void) sprintf(resource_class,"%s.%s\0",application_name,class);
  692. X    status=XrmGetResource(database,resource_name,resource_class,&resource_type,
  693. X      &resource_value);
  694. X    if (status == False)
  695. --- 2406,2442 ----
  696. X    if (database == (XrmDatabase) NULL)
  697. X      return(resource_default);
  698. X    *resource_name='\0';
  699. X    *resource_class='\0';
  700. !   if (keyword != (char *) NULL)
  701. !     {
  702. !       unsigned char
  703. !         c,
  704. !         k;
  705. !      
  706. !       /*
  707. !         Initialize resource keyword and class.
  708. !       */
  709. !       (void) sprintf(resource_name,"%s.%s\0",client,keyword);
  710. !       c=(*client);
  711. !       if ((c >= XK_a) && (c <= XK_z))
  712. !         c-=(XK_a-XK_A);
  713. !       else
  714. !         if ((c >= XK_agrave) && (c <= XK_odiaeresis))
  715. !           c-=(XK_agrave-XK_Agrave);
  716. !         else
  717. !           if ((c >= XK_oslash) && (c <= XK_thorn))
  718. !             c-=(XK_oslash-XK_Ooblique);
  719. !       k=(*keyword);
  720. !       if ((k >= XK_a) && (k <= XK_z))
  721. !         k-=(XK_a-XK_A);
  722. !       else
  723. !         if ((k >= XK_agrave) && (k <= XK_odiaeresis))
  724. !           k-=(XK_agrave-XK_Agrave);
  725. !         else
  726. !           if ((k >= XK_oslash) && (k <= XK_thorn))
  727. !             k-=(XK_oslash-XK_Ooblique);
  728. !       (void) sprintf(resource_class,"%c%s.%c%s\0",c,client+1,k,keyword+1);
  729. !     }
  730. X    status=XrmGetResource(database,resource_name,resource_class,&resource_type,
  731. X      &resource_value);
  732. X    if (status == False)
  733. ***************
  734. *** 2426,2432 ****
  735. X  %
  736. X  %  The format of the XGetResourceInfo routine is:
  737. X  %
  738. ! %      XGetResourceInfo(resource_database,application_name,resource_info)
  739. X  %
  740. X  %  A description of each parameter follows:
  741. X  %
  742. --- 2459,2465 ----
  743. X  %
  744. X  %  The format of the XGetResourceInfo routine is:
  745. X  %
  746. ! %      XGetResourceInfo(resource_database,client_name,resource_info)
  747. X  %
  748. X  %  A description of each parameter follows:
  749. X  %
  750. ***************
  751. *** 2433,2439 ****
  752. X  %    o resource_database: Specifies a resource database; returned from
  753. X  %      XrmGetStringDatabase.
  754. X  %
  755. ! %    o application_name:  Specifies the application name used to retrieve
  756. X  %      resource info from the X server database.
  757. X  %
  758. X  %    o resource_info: Specifies a pointer to a X11 XResourceInfo structure.
  759. --- 2466,2472 ----
  760. X  %    o resource_database: Specifies a resource database; returned from
  761. X  %      XrmGetStringDatabase.
  762. X  %
  763. ! %    o client_name:  Specifies the application name used to retrieve
  764. X  %      resource info from the X server database.
  765. X  %
  766. X  %    o resource_info: Specifies a pointer to a X11 XResourceInfo structure.
  767. ***************
  768. *** 2440,2451 ****
  769. X  %
  770. X  %
  771. X  */
  772. ! void XGetResourceInfo(resource_database,application_name,resource_info)
  773. X  XrmDatabase
  774. X    resource_database;
  775. X  
  776. X  char
  777. !   *application_name;
  778. X  
  779. X  XResourceInfo
  780. X    *resource_info;
  781. --- 2473,2484 ----
  782. X  %
  783. X  %
  784. X  */
  785. ! void XGetResourceInfo(resource_database,client_name,resource_info)
  786. X  XrmDatabase
  787. X    resource_database;
  788. X  
  789. X  char
  790. !   *client_name;
  791. X  
  792. X  XResourceInfo
  793. X    *resource_info;
  794. ***************
  795. *** 2456,2473 ****
  796. X    /*
  797. X      Initialize resource info fields.
  798. X    */
  799. !   resource_value=XGetResource(resource_database,application_name,"backdrop",
  800. !     (char *) NULL,"False");
  801. X    resource_info->backdrop=IsTrue(resource_value);
  802. !   resource_info->background_color=XGetResource(resource_database,
  803. !     application_name,"background","Background","black");
  804. !   resource_info->border_color=XGetResource(resource_database,application_name,
  805. !     "borderColor","BorderColor","white");
  806. !   resource_value=XGetResource(resource_database,application_name,"borderWidth",
  807. !     "BorderWidth","2");
  808. X    resource_info->border_width=atoi(resource_value);
  809. !   resource_value=XGetResource(resource_database,application_name,"colormap",
  810. !     (char *) NULL,"shared");
  811. X    resource_info->colormap=UndefinedColormap;
  812. X    if (Latin1Compare("private",resource_value) == 0)
  813. X      resource_info->colormap=PrivateColormap;
  814. --- 2489,2504 ----
  815. X    /*
  816. X      Initialize resource info fields.
  817. X    */
  818. !   resource_value=XGetResource(resource_database,client_name,"backdrop","False");
  819. X    resource_info->backdrop=IsTrue(resource_value);
  820. !   resource_info->background_color=
  821. !     XGetResource(resource_database,client_name,"background","black");
  822. !   resource_info->border_color=
  823. !     XGetResource(resource_database,client_name,"borderColor","white");
  824. !   resource_value=XGetResource(resource_database,client_name,"borderWidth","2");
  825. X    resource_info->border_width=atoi(resource_value);
  826. !   resource_value=
  827. !     XGetResource(resource_database,client_name,"colormap","shared");
  828. X    resource_info->colormap=UndefinedColormap;
  829. X    if (Latin1Compare("private",resource_value) == 0)
  830. X      resource_info->colormap=PrivateColormap;
  831. ***************
  832. *** 2475,2485 ****
  833. X      resource_info->colormap=SharedColormap;
  834. X    if (resource_info->colormap == UndefinedColormap)
  835. X      Warning("unrecognized colormap type",resource_value);
  836. !   resource_value=XGetResource(resource_database,application_name,"colors",
  837. !     (char *) NULL,"0");
  838. X    resource_info->number_colors=atoi(resource_value);
  839. !   resource_value=XGetResource(resource_database,application_name,"colorspace",
  840. !     (char *) NULL,"rgb");
  841. X    resource_info->colorspace=UndefinedColorspace;
  842. X    if (Latin1Compare("gray",resource_value) == 0)
  843. X      resource_info->colorspace=GRAYColorspace;
  844. --- 2506,2514 ----
  845. X      resource_info->colormap=SharedColormap;
  846. X    if (resource_info->colormap == UndefinedColormap)
  847. X      Warning("unrecognized colormap type",resource_value);
  848. !   resource_value=XGetResource(resource_database,client_name,"colors","0");
  849. X    resource_info->number_colors=atoi(resource_value);
  850. !   resource_value=XGetResource(resource_database,client_name,"colorspace","rgb");
  851. X    resource_info->colorspace=UndefinedColorspace;
  852. X    if (Latin1Compare("gray",resource_value) == 0)
  853. X      resource_info->colorspace=GRAYColorspace;
  854. ***************
  855. *** 2493,2533 ****
  856. X      resource_info->colorspace=XYZColorspace;
  857. X    if (resource_info->colorspace == UndefinedColorspace)
  858. X      Warning("unrecognized colorspace type",resource_value);
  859. !   resource_value=XGetResource(resource_database,application_name,"debug",
  860. !     (char *) NULL,"False");
  861. X    resource_info->debug=IsTrue(resource_value);
  862. !   resource_value=XGetResource(resource_database,application_name,"delay",
  863. !     (char *) NULL,"0");
  864. X    resource_info->delay=atoi(resource_value);
  865. !   resource_value=XGetResource(resource_database,application_name,"dither",
  866. !     (char *) NULL,"False");
  867. X    resource_info->dither=IsTrue(resource_value);
  868. !   resource_info->font=XGetResource(resource_database,application_name,
  869. !     "font","Font",(char *) NULL);
  870. !   resource_info->font_name[0]=XGetResource(resource_database,application_name,
  871. !     "font1","Font1","fixed");
  872. !   resource_info->font_name[1]=XGetResource(resource_database,application_name,
  873. !     "font2","Font2","variable");
  874. !   resource_info->font_name[2]=XGetResource(resource_database,application_name,
  875. !     "font3","Font3","5x8");
  876. !   resource_info->font_name[3]=XGetResource(resource_database,application_name,
  877. !     "font4","Font4","6x10");
  878. !   resource_info->font_name[4]=XGetResource(resource_database,application_name,
  879. !     "font5","Font5","7x13bold");
  880. !   resource_info->font_name[5]=XGetResource(resource_database,application_name,
  881. !     "font6","Font6","8x13bold");
  882. !   resource_info->font_name[6]=XGetResource(resource_database,application_name,
  883. !     "font7","Font7","9x15bold");
  884. !   resource_info->font_name[7]=XGetResource(resource_database,application_name,
  885. !     "font8","Font8","10x20");
  886. !   resource_info->font_name[8]=XGetResource(resource_database,application_name,
  887. !     "font9","Font9","12x24");
  888. !   resource_info->foreground_color=XGetResource(resource_database,
  889. !     application_name,"foreground","Foreground","white");
  890. !   resource_info->icon_geometry=XGetResource(resource_database,
  891. !     application_name,"iconGeometry","IconGeometry",(char *) NULL);
  892. !   resource_value=XGetResource(resource_database,application_name,"gravity",
  893. !     (char *) NULL,"Center");
  894. X    resource_info->gravity=(-1);
  895. X    if (Latin1Compare("Forget",resource_value) == 0)
  896. X      resource_info->gravity=ForgetGravity;
  897. --- 2522,2558 ----
  898. X      resource_info->colorspace=XYZColorspace;
  899. X    if (resource_info->colorspace == UndefinedColorspace)
  900. X      Warning("unrecognized colorspace type",resource_value);
  901. !   resource_value=XGetResource(resource_database,client_name,"debug","False");
  902. X    resource_info->debug=IsTrue(resource_value);
  903. !   resource_value=XGetResource(resource_database,client_name,"delay","0");
  904. X    resource_info->delay=atoi(resource_value);
  905. !   resource_value=XGetResource(resource_database,client_name,"dither","False");
  906. X    resource_info->dither=IsTrue(resource_value);
  907. !   resource_info->font=
  908. !     XGetResource(resource_database,client_name,"font",(char *) NULL);
  909. !   resource_info->font_name[0]=
  910. !     XGetResource(resource_database,client_name,"font1","fixed");
  911. !   resource_info->font_name[1]=
  912. !     XGetResource(resource_database,client_name,"font2","variable");
  913. !   resource_info->font_name[2]=
  914. !     XGetResource(resource_database,client_name,"font3","5x8");
  915. !   resource_info->font_name[3]=
  916. !     XGetResource(resource_database,client_name,"font4","6x10");
  917. !   resource_info->font_name[4]=
  918. !     XGetResource(resource_database,client_name,"font5","7x13bold");
  919. !   resource_info->font_name[5]=
  920. !     XGetResource(resource_database,client_name,"font6","8x13bold");
  921. !   resource_info->font_name[6]=
  922. !     XGetResource(resource_database,client_name,"font7","9x15bold");
  923. !   resource_info->font_name[7]=
  924. !     XGetResource(resource_database,client_name,"font8","10x20");
  925. !   resource_info->font_name[8]=
  926. !     XGetResource(resource_database,client_name,"font9","12x24");
  927. !   resource_info->foreground_color=
  928. !     XGetResource(resource_database,client_name,"foreground","white");
  929. !   resource_info->icon_geometry=
  930. !     XGetResource(resource_database,client_name,"iconGeometry",(char *) NULL);
  931. !   resource_value=XGetResource(resource_database,client_name,"gravity","Center");
  932. X    resource_info->gravity=(-1);
  933. X    if (Latin1Compare("Forget",resource_value) == 0)
  934. X      resource_info->gravity=ForgetGravity;
  935. ***************
  936. *** 2552,2602 ****
  937. X    if (Latin1Compare("Static",resource_value) == 0)
  938. X      resource_info->gravity=StaticGravity;
  939. X    if (resource_info->gravity == (-1))
  940. !     Warning("unrecognized gravity type",resource_value);
  941. !   resource_value=XGetResource(resource_database,application_name,"iconic",
  942. !     "Iconic","False");
  943. X    resource_info->iconic=IsTrue(resource_value);
  944. !   resource_info->image_geometry=XGetResource(resource_database,
  945. !     application_name,"imageGeometry","ImageGeometry",(char *) NULL);
  946. !   resource_value=XGetResource(resource_database,application_name,"magnify",
  947. !     (char *) NULL,"2");
  948. X    resource_info->magnify=atoi(resource_value);
  949. !   resource_info->map_type=XGetResource(resource_database,application_name,"map",
  950. !     "Map",(char *) NULL);
  951. !   resource_value=XGetResource(resource_database,application_name,"monochrome",
  952. !     (char *) NULL,"False");
  953. X    resource_info->monochrome=IsTrue(resource_value);
  954. !   resource_info->name=XGetResource(resource_database,application_name,"name",
  955. !     "Name",(char *) NULL);
  956. !   resource_info->pen_color[0]=XGetResource(resource_database,application_name,
  957. !     "pen1","Pen1","black");
  958. !   resource_info->pen_color[1]=XGetResource(resource_database,application_name,
  959. !     "pen2","Pen2","blue");
  960. !   resource_info->pen_color[2]=XGetResource(resource_database,application_name,
  961. !     "pen3","Pen3","cyan");
  962. !   resource_info->pen_color[3]=XGetResource(resource_database,application_name,
  963. !     "pen4","Pen4","green");
  964. !   resource_info->pen_color[4]=XGetResource(resource_database,application_name,
  965. !     "pen5","Pen5","gray");
  966. !   resource_info->pen_color[5]=XGetResource(resource_database,application_name,
  967. !     "pen6","Pen6","red");
  968. !   resource_info->pen_color[6]=XGetResource(resource_database,application_name,
  969. !     "pen7","Pen7","magenta");
  970. !   resource_info->pen_color[7]=XGetResource(resource_database,application_name,
  971. !     "pen8","Pen8","yellow");
  972. !   resource_info->pen_color[8]=XGetResource(resource_database,application_name,
  973. !     "pen9","Pen9","white");
  974. !   resource_info->print_filename=XGetResource(resource_database,application_name,
  975. !     "printFilename",(char *) NULL,(char *) NULL);
  976. !   resource_info->title=XGetResource(resource_database,application_name,"title",
  977. !     "Title",(char *) NULL);
  978. !   resource_value=XGetResource(resource_database,application_name,"treeDepth",
  979. !     (char *) NULL,"0");
  980. X    resource_info->tree_depth=atoi(resource_value);
  981. !   resource_info->write_filename=XGetResource(resource_database,application_name,
  982. !     "writeFilename",(char *) NULL,(char *) NULL);
  983. !   resource_info->visual_type=XGetResource(resource_database,application_name,
  984. !     "visual","Visual",(char *) NULL);
  985. X  }
  986. X  
  987. X  /*
  988. --- 2577,2627 ----
  989. X    if (Latin1Compare("Static",resource_value) == 0)
  990. X      resource_info->gravity=StaticGravity;
  991. X    if (resource_info->gravity == (-1))
  992. !     {
  993. !       Warning("unrecognized gravity type",resource_value);
  994. !       resource_info->gravity=CenterGravity;
  995. !     }
  996. !   resource_value=XGetResource(resource_database,client_name,"iconic","False");
  997. X    resource_info->iconic=IsTrue(resource_value);
  998. !   resource_info->image_geometry=
  999. !     XGetResource(resource_database,client_name,"imageGeometry",(char *) NULL);
  1000. !   resource_value=XGetResource(resource_database,client_name,"magnify","2");
  1001. X    resource_info->magnify=atoi(resource_value);
  1002. !   resource_info->map_type=
  1003. !     XGetResource(resource_database,client_name,"map",(char *) NULL);
  1004. !   resource_value=
  1005. !     XGetResource(resource_database,client_name,"monochrome","False");
  1006. X    resource_info->monochrome=IsTrue(resource_value);
  1007. !   resource_info->name=
  1008. !     XGetResource(resource_database,client_name,"name",(char *) NULL);
  1009. !   resource_info->pen_color[0]=
  1010. !     XGetResource(resource_database,client_name,"pen1","black");
  1011. !   resource_info->pen_color[1]=
  1012. !     XGetResource(resource_database,client_name,"pen2","blue");
  1013. !   resource_info->pen_color[2]=
  1014. !     XGetResource(resource_database,client_name,"pen3","cyan");
  1015. !   resource_info->pen_color[3]=
  1016. !     XGetResource(resource_database,client_name,"pen4","green");
  1017. !   resource_info->pen_color[4]=
  1018. !     XGetResource(resource_database,client_name,"pen5","gray");
  1019. !   resource_info->pen_color[5]=
  1020. !     XGetResource(resource_database,client_name,"pen6","red");
  1021. !   resource_info->pen_color[6]=
  1022. !     XGetResource(resource_database,client_name,"pen7","magenta");
  1023. !   resource_info->pen_color[7]=
  1024. !     XGetResource(resource_database,client_name,"pen8","yellow");
  1025. !   resource_info->pen_color[8]=
  1026. !     XGetResource(resource_database,client_name,"pen9","white");
  1027. !   resource_info->print_filename=
  1028. !     XGetResource(resource_database,client_name,"printFilename",(char *) NULL);
  1029. !   resource_info->title=
  1030. !     XGetResource(resource_database,client_name,"title",(char *) NULL);
  1031. !   resource_value=XGetResource(resource_database,client_name,"treeDepth","0");
  1032. X    resource_info->tree_depth=atoi(resource_value);
  1033. !   resource_info->write_filename=
  1034. !     XGetResource(resource_database,client_name,"writeFilename",(char *) NULL);
  1035. !   resource_info->visual_type=
  1036. !     XGetResource(resource_database,client_name,"visual",(char *) NULL);
  1037. X  }
  1038. X  
  1039. X  /*
  1040. ***************
  1041. *** 2748,2754 ****
  1042. X              clip_x,
  1043. X              clip_y;
  1044. X  
  1045. !           unsigned
  1046. X              clip_height,
  1047. X              clip_width;
  1048. X  
  1049. --- 2773,2779 ----
  1050. X              clip_x,
  1051. X              clip_y;
  1052. X  
  1053. !           unsigned int
  1054. X              clip_height,
  1055. X              clip_width;
  1056. X  
  1057. diff -r -c ImageMagick/X.h ImageMagick2.2.1/X.h
  1058. *** ImageMagick/X.h    Mon Dec  7 09:23:03 1992
  1059. --- ImageMagick2.2.1/X.h    Fri Dec 18 17:07:28 1992
  1060. ***************
  1061. *** 243,249 ****
  1062. X    X utilities routines.
  1063. X  */
  1064. X  extern char 
  1065. !   *XGetResource _Declare((XrmDatabase,char *,char *,char *,char *)),
  1066. X    *XVisualClassName _Declare((XVisualInfo *));
  1067. X  
  1068. X  extern Cursor 
  1069. --- 243,249 ----
  1070. X    X utilities routines.
  1071. X  */
  1072. X  extern char 
  1073. !   *XGetResource _Declare((XrmDatabase,char *,char *,char *)),
  1074. X    *XVisualClassName _Declare((XVisualInfo *));
  1075. X  
  1076. X  extern Cursor 
  1077. diff -r -c ImageMagick/XtoPS.c ImageMagick2.2.1/XtoPS.c
  1078. *** ImageMagick/XtoPS.c    Mon Dec  7 09:12:50 1992
  1079. --- ImageMagick2.2.1/XtoPS.c    Fri Dec 18 17:07:26 1992
  1080. ***************
  1081. *** 87,93 ****
  1082. X    Global declarations.
  1083. X  */
  1084. X  char
  1085. !   *application_name;
  1086. X  
  1087. X  /*
  1088. X  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1089. --- 87,93 ----
  1090. X    Global declarations.
  1091. X  */
  1092. X  char
  1093. !   *client_name;
  1094. X  
  1095. X  /*
  1096. X  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1097. ***************
  1098. *** 120,126 ****
  1099. X    *message,
  1100. X    *qualifier;
  1101. X  {
  1102. !   (void) fprintf(stderr,"%s: %s",application_name,message);
  1103. X    if (qualifier != (char *) NULL)
  1104. X      (void) fprintf(stderr," (%s)",qualifier);
  1105. X    (void) fprintf(stderr,".\n");
  1106. --- 120,126 ----
  1107. X    *message,
  1108. X    *qualifier;
  1109. X  {
  1110. !   (void) fprintf(stderr,"%s: %s",client_name,message);
  1111. X    if (qualifier != (char *) NULL)
  1112. X      (void) fprintf(stderr," (%s)",qualifier);
  1113. X    (void) fprintf(stderr,".\n");
  1114. ***************
  1115. *** 167,173 ****
  1116. X        "-window id          select window with this id or name",
  1117. X        (char *) NULL
  1118. X      };
  1119. !   (void) fprintf(stderr,"Usage: %s [options ...] file\n",application_name);
  1120. X    (void) fprintf(stderr,"\nWhere options include:\n");
  1121. X    for (p=options; *p != (char *) NULL; p++)
  1122. X      (void) fprintf(stderr,"  %s\n",*p);
  1123. --- 167,173 ----
  1124. X        "-window id          select window with this id or name",
  1125. X        (char *) NULL
  1126. X      };
  1127. !   (void) fprintf(stderr,"Usage: %s [options ...] file\n",client_name);
  1128. X    (void) fprintf(stderr,"\nWhere options include:\n");
  1129. X    for (p=options; *p != (char *) NULL; p++)
  1130. X      (void) fprintf(stderr,"  %s\n",*p);
  1131. ***************
  1132. *** 201,207 ****
  1133. X  {
  1134. X    char
  1135. X      *filename,
  1136. -     *image_geometry,
  1137. X      *option,
  1138. X      *resource_value,
  1139. X      *scale_geometry,
  1140. --- 201,206 ----
  1141. ***************
  1142. *** 238,244 ****
  1143. X    /*
  1144. X      Display usage profile if there are no command line arguments.
  1145. X    */
  1146. !   application_name=(*argv);
  1147. X    if (argc < 2)
  1148. X      Usage();
  1149. X    /*
  1150. --- 237,243 ----
  1151. X    /*
  1152. X      Display usage profile if there are no command line arguments.
  1153. X    */
  1154. !   client_name=(*argv);
  1155. X    if (argc < 2)
  1156. X      Usage();
  1157. X    /*
  1158. ***************
  1159. *** 284,308 ****
  1160. X    /*
  1161. X      Get user defaults from X resource database.
  1162. X    */
  1163. !   XGetResourceInfo(resource_database,application_name,&resource_info);
  1164. !   resource_value=XGetResource(resource_database,application_name,"borders",
  1165. !     (char *) NULL,"False");
  1166. X    borders=IsTrue(resource_value);
  1167. !   resource_value=XGetResource(resource_database,application_name,"frame",
  1168. !     (char *) NULL,"False");
  1169. X    frame=IsTrue(resource_value);
  1170. !   image_geometry=XGetResource(resource_database,application_name,
  1171. !     "imageGeometry","ImageGeometry",(char *) NULL);
  1172. !   resource_value=XGetResource(resource_database,application_name,"rotate",
  1173. !     (char *) NULL,"False");
  1174. !   scale_geometry=XGetResource(resource_database,application_name,
  1175. !     "scaleGeometry","ScaleGeometry",(char *) NULL);
  1176. X    degrees=atoi(resource_value);
  1177. !   resource_value=XGetResource(resource_database,application_name,"screen",
  1178. !     (char *) NULL,"False");
  1179. X    screen=IsTrue(resource_value);
  1180. !   resource_value=XGetResource(resource_database,application_name,"verbose",
  1181. !     (char *) NULL,"False");
  1182. X    verbose=IsTrue(resource_value);
  1183. X    /*
  1184. X      Check command syntax.
  1185. --- 283,300 ----
  1186. X    /*
  1187. X      Get user defaults from X resource database.
  1188. X    */
  1189. !   XGetResourceInfo(resource_database,client_name,&resource_info);
  1190. !   resource_value=XGetResource(resource_database,client_name,"borders","False");
  1191. X    borders=IsTrue(resource_value);
  1192. !   resource_value=XGetResource(resource_database,client_name,"frame","False");
  1193. X    frame=IsTrue(resource_value);
  1194. !   resource_value=XGetResource(resource_database,client_name,"rotate","False");
  1195. !   scale_geometry=
  1196. !     XGetResource(resource_database,client_name,"scaleGeometry",(char *) NULL);
  1197. X    degrees=atoi(resource_value);
  1198. !   resource_value=XGetResource(resource_database,client_name,"screen","False");
  1199. X    screen=IsTrue(resource_value);
  1200. !   resource_value=XGetResource(resource_database,client_name,"verbose","False");
  1201. X    verbose=IsTrue(resource_value);
  1202. X    /*
  1203. X      Check command syntax.
  1204. ***************
  1205. *** 359,365 ****
  1206. X            i++;
  1207. X            if (i == argc)
  1208. X              Error("missing geometry on -geometry",(char *) NULL);
  1209. !           image_geometry=argv[i];
  1210. X            break;
  1211. X          }
  1212. X          case 'h':
  1213. --- 351,357 ----
  1214. X            i++;
  1215. X            if (i == argc)
  1216. X              Error("missing geometry on -geometry",(char *) NULL);
  1217. !           resource_info.image_geometry=argv[i];
  1218. X            break;
  1219. X          }
  1220. X          case 'h':
  1221. ***************
  1222. *** 442,449 ****
  1223. X    image=ReadXImage(target_window,server_name,frame,screen,borders);
  1224. X    if (image == (Image *) NULL)
  1225. X      exit(1);
  1226. !   if (image_geometry || scale_geometry)
  1227. !     TransformImage(&image,(char *) NULL,image_geometry,scale_geometry);
  1228. X    if ((degrees % 360) != 0)
  1229. X      {
  1230. X        Image
  1231. --- 434,442 ----
  1232. X    image=ReadXImage(target_window,server_name,frame,screen,borders);
  1233. X    if (image == (Image *) NULL)
  1234. X      exit(1);
  1235. !   if (resource_info.image_geometry || scale_geometry)
  1236. !     TransformImage(&image,(char *) NULL,resource_info.image_geometry,
  1237. !       scale_geometry);
  1238. X    if ((degrees % 360) != 0)
  1239. X      {
  1240. X        Image
  1241. ***************
  1242. *** 462,468 ****
  1243. X    if (resource_info.monochrome)
  1244. X      QuantizeImage(image,2,8,False,GRAYColorspace,True);
  1245. X    (void) strcpy(image->filename,filename);
  1246. !   (void) PrintImage(image,image_geometry);
  1247. X    if (verbose)
  1248. X      {
  1249. X        /*
  1250. --- 455,461 ----
  1251. X    if (resource_info.monochrome)
  1252. X      QuantizeImage(image,2,8,False,GRAYColorspace,True);
  1253. X    (void) strcpy(image->filename,filename);
  1254. !   (void) PrintImage(image,resource_info.image_geometry);
  1255. X    if (verbose)
  1256. X      {
  1257. X        /*
  1258. ***************
  1259. *** 469,475 ****
  1260. X          Display detailed info about the image.
  1261. X        */
  1262. X        if (image->class == DirectClass)
  1263. !         image->colors=NumberColors(image);
  1264. X        (void) fprintf(stderr,"[%u] %s %ux%u",image->scene,image->filename,
  1265. X          image->columns,image->rows);
  1266. X        if (image->class == DirectClass)
  1267. --- 462,468 ----
  1268. X          Display detailed info about the image.
  1269. X        */
  1270. X        if (image->class == DirectClass)
  1271. !         image->colors=NumberColors(image,(FILE *) NULL);
  1272. X        (void) fprintf(stderr,"[%u] %s %ux%u",image->scene,image->filename,
  1273. X          image->columns,image->rows);
  1274. X        if (image->class == DirectClass)
  1275. diff -r -c ImageMagick/XtoPS.man ImageMagick2.2.1/XtoPS.man
  1276. *** ImageMagick/XtoPS.man    Mon Dec  7 19:52:59 1992
  1277. --- ImageMagick2.2.1/XtoPS.man    Fri Dec 18 17:07:31 1992
  1278. ***************
  1279. *** 79,84 ****
  1280. --- 79,87 ----
  1281. X  .B "-rotate \fIdegrees\fP"
  1282. X  apply Paeth image rotation to the image.
  1283. X  
  1284. + Empty triangles left over from rotating the image are filled with
  1285. + the color defined by the pixel at location (0,0).
  1286. X  By default the image is output in portrait mode.  Use \fB-rotate 90\fP to
  1287. X  display the image in landscape mode.
  1288. X  .TP 5
  1289. ***************
  1290. *** 91,98 ****
  1291. X  one factor is specified, both the width and height factors assume the
  1292. X  value.
  1293. X  
  1294. ! Factors may be fractional.  For example, a factor of 1.5 will increase the
  1295. ! image size by one and one-half.
  1296. X  .TP 5
  1297. X  .B "-screen"
  1298. X  This option indicates that the GetImage request used to obtain the image
  1299. --- 94,102 ----
  1300. X  one factor is specified, both the width and height factors assume the
  1301. X  value.
  1302. X  
  1303. ! Factors may be fractional.  To increase the size of an image, use a
  1304. ! scale factor greater than 1.0.  To decrease an image's size, use a
  1305. ! scale factor less than 1.0.  Default is 1.0.
  1306. X  .TP 5
  1307. X  .B "-screen"
  1308. X  This option indicates that the GetImage request used to obtain the image
  1309. diff -r -c ImageMagick/alien.c ImageMagick2.2.1/alien.c
  1310. *** ImageMagick/alien.c    Tue Dec  8 11:16:04 1992
  1311. --- ImageMagick2.2.1/alien.c    Sat Dec 19 02:57:52 1992
  1312. ***************
  1313. *** 68,73 ****
  1314. --- 68,74 ----
  1315. X      "FAX",
  1316. X      "GIF",
  1317. X      "GRAY",
  1318. +     "HISTOGRAM",
  1319. X      "JPEG",
  1320. X      "JPG",
  1321. X      "MIFF",
  1322. ***************
  1323. *** 92,99 ****
  1324. X    External declarations.
  1325. X  */
  1326. X  extern char
  1327. !   *application_name;
  1328. X  /*
  1329. X  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1330. X  %                                                                             %
  1331. --- 93,99 ----
  1332. X    External declarations.
  1333. X  */
  1334. X  extern char
  1335. !   *client_name;
  1336. X  /*
  1337. X  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1338. X  %                                                                             %
  1339. ***************
  1340. *** 614,620 ****
  1341. X        (void) free((char *) colormap);
  1342. X      }
  1343. X    image_count=0;
  1344. !   while (1)
  1345. X    {
  1346. X      status=ReadData((char *) &c,1,1,image->file);
  1347. X      if (status == False)
  1348. --- 614,620 ----
  1349. X        (void) free((char *) colormap);
  1350. X      }
  1351. X    image_count=0;
  1352. !   for ( ; ; )
  1353. X    {
  1354. X      status=ReadData((char *) &c,1,1,image->file);
  1355. X      if (status == False)
  1356. ***************
  1357. *** 4732,4737 ****
  1358. --- 4732,4784 ----
  1359. X    return(True);
  1360. X  }
  1361. X  
  1362. + /*
  1363. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1364. + %                                                                             %
  1365. + %                                                                             %
  1366. + %                                                                             %
  1367. + %   W r i t e H I S T O G R A M I m a g e                                     %
  1368. + %                                                                             %
  1369. + %                                                                             %
  1370. + %                                                                             %
  1371. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1372. + %
  1373. + %  Function WriteHISTOGRAMImage writes an image to a file in HISTOGRAM format.
  1374. + %  A list of unique pixel values and the number of times each occurs in the
  1375. + %  image is written to the file.
  1376. + %
  1377. + %  The format of the WriteHISTOGRAMImage routine is:
  1378. + %
  1379. + %      status=WriteAVSImage(image)
  1380. + %
  1381. + %  A description of each parameter follows.
  1382. + %
  1383. + %    o status: Function WriteImage return True if the image is written.
  1384. + %      False is returned is there is a memory shortage or if the image file
  1385. + %      fails to write.
  1386. + %
  1387. + %    o image:  A pointer to a Image structure.
  1388. + %
  1389. + %
  1390. + */
  1391. + static unsigned int WriteHISTOGRAMImage(image)
  1392. + Image
  1393. +   *image;
  1394. + {
  1395. +   /*
  1396. +     Open output image file.
  1397. +   */
  1398. +   OpenImage(image,"w");
  1399. +   if (image->file == (FILE *) NULL)
  1400. +     {
  1401. +       Warning("unable to open file",image->filename);
  1402. +       return(False);
  1403. +     }
  1404. +   (void) NumberColors(image,image->file);
  1405. +   CloseImage(image);
  1406. +   return(True);
  1407. + }
  1408. X  #ifdef AlienJPEG
  1409. X  /*
  1410. X  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1411. ***************
  1412. *** 5117,5126 ****
  1413. X        */
  1414. X        format='5';
  1415. X        if (image->colors == 2)
  1416. !         {
  1417. !           format='4';
  1418. !           packets/=8;
  1419. !         }
  1420. X        for (i=0; i < image->colors; i++)
  1421. X          if ((image->colormap[i].red != image->colormap[i].green) ||
  1422. X              (image->colormap[i].green != image->colormap[i].blue))
  1423. --- 5164,5170 ----
  1424. X        */
  1425. X        format='5';
  1426. X        if (image->colors == 2)
  1427. !         format='4';
  1428. X        for (i=0; i < image->colors; i++)
  1429. X          if ((image->colormap[i].red != image->colormap[i].green) ||
  1430. X              (image->colormap[i].green != image->colormap[i].blue))
  1431. ***************
  1432. *** 5192,5197 ****
  1433. --- 5236,5242 ----
  1434. X          }
  1435. X          p++;
  1436. X        }
  1437. +       packets=q-pixels;
  1438. X        break;
  1439. X      }
  1440. X      case '5':
  1441. ***************
  1442. *** 5210,5229 ****
  1443. X      }
  1444. X      case '6':
  1445. X      {
  1446. X        /*
  1447. X          Convert image to a PNM image.
  1448. X        */
  1449. X        (void) fprintf(image->file,"%d\n",MaxRGB);
  1450. !       for (i=0; i < image->packets; i++)
  1451. !       {
  1452. !         for (j=0; j <= ((int) p->length); j++)
  1453. X          {
  1454. !           *q++=p->red;
  1455. !           *q++=p->green;
  1456. !           *q++=p->blue;
  1457. X          }
  1458. !         p++;
  1459. !       }
  1460. X        break;
  1461. X      }
  1462. X    }
  1463. --- 5255,5290 ----
  1464. X      }
  1465. X      case '6':
  1466. X      {
  1467. +       unsigned short int
  1468. +         index;
  1469. X        /*
  1470. X          Convert image to a PNM image.
  1471. X        */
  1472. X        (void) fprintf(image->file,"%d\n",MaxRGB);
  1473. !       if (image->class == DirectClass)
  1474. !         for (i=0; i < image->packets; i++)
  1475. X          {
  1476. !           for (j=0; j <= ((int) p->length); j++)
  1477. !           {
  1478. !             *q++=p->red;
  1479. !             *q++=p->green;
  1480. !             *q++=p->blue;
  1481. !           }
  1482. !           p++;
  1483. X          }
  1484. !       else
  1485. !         for (i=0; i < image->packets; i++)
  1486. !         {
  1487. !           for (j=0; j <= ((int) p->length); j++)
  1488. !           {
  1489. !             index=p->index;
  1490. !             *q++=image->colormap[index].red;
  1491. !             *q++=image->colormap[index].green;
  1492. !             *q++=image->colormap[index].blue;
  1493. !           }
  1494. !           p++;
  1495. !         }
  1496. X        break;
  1497. X      }
  1498. X    }
  1499. ***************
  1500. *** 6565,6570 ****
  1501. --- 6626,6637 ----
  1502. X            ReadGRAYImage(alien_info);
  1503. X        break;
  1504. X      }
  1505. +     case 'H':
  1506. +     {
  1507. +       Warning("Cannot read HISTOGRAM images",alien_info->filename);
  1508. +       image=ReadImage(alien_info->filename);
  1509. +       break;
  1510. +     }
  1511. X      case 'J':
  1512. X      {
  1513. X        image=ReadJPEGImage(alien_info);
  1514. ***************
  1515. *** 6776,6781 ****
  1516. --- 6843,6853 ----
  1517. X          status=WriteGIFImage(&alien_image);
  1518. X        else
  1519. X          status=WriteGRAYImage(&alien_image);
  1520. +       break;
  1521. +     }
  1522. +     case 'H':
  1523. +     {
  1524. +       status=WriteHISTOGRAMImage(&alien_image);
  1525. X        break;
  1526. X      }
  1527. X      case 'J':
  1528. diff -r -c ImageMagick/animate.c ImageMagick2.2.1/animate.c
  1529. *** ImageMagick/animate.c    Tue Dec  8 11:13:52 1992
  1530. --- ImageMagick2.2.1/animate.c    Fri Dec 18 17:07:27 1992
  1531. ***************
  1532. *** 139,145 ****
  1533. X    Global declarations.
  1534. X  */
  1535. X  char
  1536. !   *application_name;
  1537. X  
  1538. X  /*
  1539. X  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1540. --- 139,145 ----
  1541. X    Global declarations.
  1542. X  */
  1543. X  char
  1544. !   *client_name;
  1545. X  
  1546. X  /*
  1547. X  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1548. ***************
  1549. *** 224,230 ****
  1550. X    *message,
  1551. X    *qualifier;
  1552. X  {
  1553. !   (void) fprintf(stderr,"%s: %s",application_name,message);
  1554. X    if (qualifier != (char *) NULL)
  1555. X      (void) fprintf(stderr," (%s)",qualifier);
  1556. X    (void) fprintf(stderr,".\n");
  1557. --- 224,230 ----
  1558. X    *message,
  1559. X    *qualifier;
  1560. X  {
  1561. !   (void) fprintf(stderr,"%s: %s",client_name,message);
  1562. X    if (qualifier != (char *) NULL)
  1563. X      (void) fprintf(stderr," (%s)",qualifier);
  1564. X    (void) fprintf(stderr,".\n");
  1565. ***************
  1566. *** 306,313 ****
  1567. X        (char *) NULL
  1568. X      };
  1569. X    (void) fprintf(stderr,
  1570. !     "Usage: %s [-options ...] file [ [-options ...] file ...]\n",
  1571. !     application_name);
  1572. X    (void) fprintf(stderr,"\nWhere options include: \n");
  1573. X    for (p=options; *p != (char *) NULL; p++)
  1574. X      (void) fprintf(stderr,"  %s\n",*p);
  1575. --- 306,312 ----
  1576. X        (char *) NULL
  1577. X      };
  1578. X    (void) fprintf(stderr,
  1579. !     "Usage: %s [-options ...] file [ [-options ...] file ...]\n",client_name);
  1580. X    (void) fprintf(stderr,"\nWhere options include: \n");
  1581. X    for (p=options; *p != (char *) NULL; p++)
  1582. X      (void) fprintf(stderr,"  %s\n",*p);
  1583. ***************
  1584. *** 619,629 ****
  1585. X      *manager_hints;
  1586. X  
  1587. X    /*
  1588. -     Sort images by increasing scene number.
  1589. -   */
  1590. -   (void) qsort((void *) images,(int) number_scenes,sizeof(Image *),
  1591. -     LinearCompare);
  1592. -   /*
  1593. X      Allocate standard colormap.
  1594. X    */
  1595. X    if (resource_info->debug)
  1596. --- 618,623 ----
  1597. ***************
  1598. *** 689,694 ****
  1599. --- 683,697 ----
  1600. X    magick_windows[number_windows++]=(&window->popup);
  1601. X    for (i=0; i < number_windows; i++)
  1602. X      magick_windows[i]->id=(Window) NULL;
  1603. +   /*
  1604. +     Sort images by increasing scene number.
  1605. +   */
  1606. +   i=0;
  1607. +   for (scene=0; scene < number_scenes; scene++)
  1608. +     i+=images[scene]->scene;
  1609. +   if (i > 0)
  1610. +     (void) qsort((void *) images,(int) number_scenes,sizeof(Image *),
  1611. +       LinearCompare);
  1612. X    if (resource_info->map_type == (char *) NULL)
  1613. X      if ((visual_info->class != TrueColor) &&
  1614. X          (visual_info->class != DirectColor))
  1615. ***************
  1616. *** 770,776 ****
  1617. X      Initialize class and manager hints.
  1618. X    */
  1619. X    if (resource_info->name == (char *) NULL)
  1620. !     class_hint->res_name=application_name;
  1621. X    else
  1622. X      class_hint->res_name=resource_info->name;
  1623. X    class_hint->res_class=(char *) "ImageMagick";
  1624. --- 773,779 ----
  1625. X      Initialize class and manager hints.
  1626. X    */
  1627. X    if (resource_info->name == (char *) NULL)
  1628. !     class_hint->res_name=client_name;
  1629. X    else
  1630. X      class_hint->res_name=resource_info->name;
  1631. X    class_hint->res_class=(char *) "ImageMagick";
  1632. ***************
  1633. *** 1488,1494 ****
  1634. X    /*
  1635. X      Display usage profile if there are no command line arguments.
  1636. X    */
  1637. !   application_name=(*argv);
  1638. X    if (argc < 2)
  1639. X      Usage(True);
  1640. X    /*
  1641. --- 1491,1497 ----
  1642. X    /*
  1643. X      Display usage profile if there are no command line arguments.
  1644. X    */
  1645. !   client_name=(*argv);
  1646. X    if (argc < 2)
  1647. X      Usage(True);
  1648. X    /*
  1649. ***************
  1650. *** 1555,1576 ****
  1651. X    /*
  1652. X      Get user defaults from X resource database.
  1653. X    */
  1654. !   XGetResourceInfo(resource_database,application_name,&resource_info);
  1655. !   clip_geometry=XGetResource(resource_database,application_name,"clipGeometry",
  1656. !     "ClipGeometry",(char *) NULL);
  1657. !   resource_value=XGetResource(resource_database,application_name,"gamma",
  1658. !     (char *) NULL,"0.0");
  1659. X    gamma=atof(resource_value);
  1660. !   resource_value=XGetResource(resource_database,application_name,"reflect",
  1661. !     (char *) NULL,"False");
  1662. X    reflect=IsTrue(resource_value);
  1663. !   resource_value=XGetResource(resource_database,application_name,"rotate",
  1664. !     (char *) NULL,"0");
  1665. X    degrees=atoi(resource_value);
  1666. !   scale_geometry=XGetResource(resource_database,application_name,
  1667. !     "scaleGeometry","ScaleGeometry",(char *) NULL);
  1668. !   resource_value=XGetResource(resource_database,application_name,"verbose",
  1669. !     (char *) NULL,"False");
  1670. X    verbose=IsTrue(resource_value);
  1671. X    /*
  1672. X      Parse command line.
  1673. --- 1558,1575 ----
  1674. X    /*
  1675. X      Get user defaults from X resource database.
  1676. X    */
  1677. !   XGetResourceInfo(resource_database,client_name,&resource_info);
  1678. !   clip_geometry=
  1679. !     XGetResource(resource_database,client_name,"clipGeometry",(char *) NULL);
  1680. !   resource_value=XGetResource(resource_database,client_name,"gamma","0.0");
  1681. X    gamma=atof(resource_value);
  1682. !   resource_value=XGetResource(resource_database,client_name,"reflect","False");
  1683. X    reflect=IsTrue(resource_value);
  1684. !   resource_value=XGetResource(resource_database,client_name,"rotate","0");
  1685. X    degrees=atoi(resource_value);
  1686. !   scale_geometry=
  1687. !     XGetResource(resource_database,client_name,"scaleGeometry",(char *) NULL);
  1688. !   resource_value=XGetResource(resource_database,client_name,"verbose","False");
  1689. X    verbose=IsTrue(resource_value);
  1690. X    /*
  1691. X      Parse command line.
  1692. ***************
  1693. *** 2036,2042 ****
  1694. X                  Initialize image error attributes.
  1695. X                */
  1696. X                if (image->class == DirectClass)
  1697. !                 image->colors=NumberColors(image);
  1698. X                total_colors=image->colors;
  1699. X              }
  1700. X            if (resource_info.colorspace == GRAYColorspace)
  1701. --- 2035,2041 ----
  1702. X                  Initialize image error attributes.
  1703. X                */
  1704. X                if (image->class == DirectClass)
  1705. !                 image->colors=NumberColors(image,(FILE *) NULL);
  1706. X                total_colors=image->colors;
  1707. X              }
  1708. X            if (resource_info.colorspace == GRAYColorspace)
  1709. diff -r -c ImageMagick/animate.man ImageMagick2.2.1/animate.man
  1710. *** ImageMagick/animate.man    Mon Dec  7 19:52:59 1992
  1711. --- ImageMagick2.2.1/animate.man    Fri Dec 18 17:07:31 1992
  1712. ***************
  1713. *** 185,190 ****
  1714. --- 185,193 ----
  1715. X  .TP 5
  1716. X  .B "-rotate \fIdegrees\fP"
  1717. X  apply Paeth image rotation to the image.
  1718. + Empty triangles left over from rotating the image are filled with
  1719. + the color defined by the pixel at location (0,0).
  1720. X  .TP 5
  1721. X  .B "-scale \fI<width factor>x<height factor>\fP"
  1722. X  preferred size factors of the image.
  1723. ***************
  1724. *** 195,202 ****
  1725. X  one factor is specified, both the width and height factors assume the
  1726. X  value.
  1727. X  
  1728. ! Factors may be fractional.  For example, a factor of 1.5 will increase the
  1729. ! image size by one and one-half.
  1730. X  
  1731. X  The equivalent X resource for this option is \fBscaleGeometry\fP
  1732. X  (class \fBScaleGeometry\fP).  See \fBX RESOURCES\fP for details.
  1733. --- 198,206 ----
  1734. X  one factor is specified, both the width and height factors assume the
  1735. X  value.
  1736. X  
  1737. ! Factors may be fractional.  To increase the size of an image, use a
  1738. ! scale factor greater than 1.0.  To decrease an image's size, use a
  1739. ! scale factor less than 1.0.  Default is 1.0.
  1740. X  
  1741. X  The equivalent X resource for this option is \fBscaleGeometry\fP
  1742. X  (class \fBScaleGeometry\fP).  See \fBX RESOURCES\fP for details.
  1743. diff -r -c ImageMagick/colors.c ImageMagick2.2.1/colors.c
  1744. *** ImageMagick/colors.c    Mon Dec  7 09:14:54 1992
  1745. --- ImageMagick2.2.1/colors.c    Fri Dec 18 17:07:27 1992
  1746. ***************
  1747. *** 66,74 ****
  1748. --- 66,78 ----
  1749. X      *child[8];
  1750. X  
  1751. X    unsigned char
  1752. +     level,
  1753. X      mid_red,
  1754. X      mid_green,
  1755. X      mid_blue;
  1756. +   unsigned long int
  1757. +     number_colors;
  1758. X  } Node;
  1759. X  
  1760. X  typedef struct _Nodes
  1761. ***************
  1762. *** 83,90 ****
  1763. X  typedef struct _Cube
  1764. X  {
  1765. X    Node
  1766. !     *root,
  1767. !     *leaf;
  1768. X  
  1769. X    unsigned int
  1770. X      colors;
  1771. --- 87,93 ----
  1772. X  typedef struct _Cube
  1773. X  {
  1774. X    Node
  1775. !     *root;
  1776. X  
  1777. X    unsigned int
  1778. X      colors;
  1779. ***************
  1780. *** 109,115 ****
  1781. X    External declarations.
  1782. X  */
  1783. X  extern char
  1784. !   *application_name;
  1785. X  
  1786. X  /*
  1787. X  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1788. --- 112,118 ----
  1789. X    External declarations.
  1790. X  */
  1791. X  extern char
  1792. !   *client_name;
  1793. X  
  1794. X  /*
  1795. X  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1796. ***************
  1797. *** 116,121 ****
  1798. --- 119,170 ----
  1799. X  %                                                                             %
  1800. X  %                                                                             %
  1801. X  %                                                                             %
  1802. + %  H i s t o g r a m                                                          %
  1803. + %                                                                             %
  1804. + %                                                                             %
  1805. + %                                                                             %
  1806. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1807. + %
  1808. + %  Procedure Histogram traverses the color cube tree and produces a list of
  1809. + %  unique pixel field values and the number of times each occurs in the image.
  1810. + %
  1811. + %  The format of the Histogram routine is:
  1812. + %
  1813. + %      Histogram(node,file)
  1814. + %
  1815. + %  A description of each parameter follows.
  1816. + %
  1817. + %    o node: The address of a structure of type Node which points to a
  1818. + %      node in the color cube tree that is to be pruned.
  1819. + %
  1820. + %
  1821. + */
  1822. + static void Histogram(node,file)
  1823. + register Node
  1824. +   *node;
  1825. + FILE
  1826. +   *file;
  1827. + {
  1828. +   register unsigned int
  1829. +     id;
  1830. +   /*
  1831. +     Traverse any children.
  1832. +   */
  1833. +   for (id=0; id < 8; id++)
  1834. +     if (node->child[id] != (Node *) NULL)
  1835. +       Histogram(node->child[id],file);
  1836. +   if (node->level == MaxTreeDepth)
  1837. +     (void) fprintf(file,"%8d\t%d\t%d\t%d\n",node->number_colors,
  1838. +       node->mid_red,node->mid_green,node->mid_blue);
  1839. + }
  1840. + /*
  1841. + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1842. + %                                                                             %
  1843. + %                                                                             %
  1844. + %                                                                             %
  1845. X  %  I n i t i a l i z e N o d e                                                %
  1846. X  %                                                                             %
  1847. X  %                                                                             %
  1848. ***************
  1849. *** 127,136 ****
  1850. X  %
  1851. X  %  The format of the InitializeNode routine is:
  1852. X  %
  1853. ! %      node=InitializeNode(mid_red,mid_green,mid_blue)
  1854. X  %
  1855. X  %  A description of each parameter follows.
  1856. X  %
  1857. X  %    o mid_red: Specifies the mid point of the red axis for this node.
  1858. X  %
  1859. X  %    o mid_green: Specifies the mid point of the green axis for this node.
  1860. --- 176,187 ----
  1861. X  %
  1862. X  %  The format of the InitializeNode routine is:
  1863. X  %
  1864. ! %      node=InitializeNode(level,mid_red,mid_green,mid_blue)
  1865. X  %
  1866. X  %  A description of each parameter follows.
  1867. X  %
  1868. + %    o level: Specifies the level in the classification the node resides.
  1869. + %
  1870. X  %    o mid_red: Specifies the mid point of the red axis for this node.
  1871. X  %
  1872. X  %    o mid_green: Specifies the mid point of the green axis for this node.
  1873. ***************
  1874. *** 139,146 ****
  1875. X  %
  1876. X  %
  1877. X  */
  1878. ! static Node *InitializeNode(mid_red,mid_green,mid_blue)
  1879. ! register unsigned char
  1880. X    mid_red,
  1881. X    mid_green,
  1882. X    mid_blue;
  1883. --- 190,198 ----
  1884. X  %
  1885. X  %
  1886. X  */
  1887. ! static Node *InitializeNode(level,mid_red,mid_green,mid_blue)
  1888. ! unsigned int
  1889. !   level,
  1890. X    mid_red,
  1891. X    mid_green,
  1892. X    mid_blue;
  1893. ***************
  1894. *** 171,179 ****
  1895. --- 223,233 ----
  1896. X    node=cube.node++;
  1897. X    for (i=0; i < 8; i++)
  1898. X      node->child[i]=(Node *) NULL;
  1899. +   node->level=level;
  1900. X    node->mid_red=mid_red;
  1901. X    node->mid_green=mid_green;
  1902. X    node->mid_blue=mid_blue;
  1903. +   node->number_colors=0;
  1904. X    return(node);
  1905. X  }
  1906. X  
  1907. ***************
  1908. *** 192,198 ****
  1909. X  %
  1910. X  %  The format of the NumberColors routine is:
  1911. X  %
  1912. ! %      number_colors=NumberColors(image)
  1913. X  %
  1914. X  %  A description of each parameter follows.
  1915. X  %
  1916. --- 246,252 ----
  1917. X  %
  1918. X  %  The format of the NumberColors routine is:
  1919. X  %
  1920. ! %      number_colors=NumberColors(image,file)
  1921. X  %
  1922. X  %  A description of each parameter follows.
  1923. X  %
  1924. ***************
  1925. *** 201,211 ****
  1926. X  %      run-length counts in the source image must be equal to or exceed
  1927. X  %      the number of pixels.
  1928. X  %
  1929. X  %
  1930. X  */
  1931. ! unsigned int NumberColors(image)
  1932. X  Image
  1933. X    *image;
  1934. X  {
  1935. X    Nodes
  1936. X      *nodes;
  1937. --- 255,273 ----
  1938. X  %      run-length counts in the source image must be equal to or exceed
  1939. X  %      the number of pixels.
  1940. X  %
  1941. + %    o file:  An pointer to a FILE.  If it is non-null a list of unique pixel
  1942. + %      field values and the number of times each occurs in the image is 
  1943. + %      written to the file.
  1944. + %      
  1945. X  %
  1946. + %
  1947. X  */
  1948. ! unsigned int NumberColors(image,file)
  1949. X  Image
  1950. X    *image;
  1951. + FILE
  1952. +   *file;
  1953. X  {
  1954. X    Nodes
  1955. X      *nodes;
  1956. ***************
  1957. *** 219,231 ****
  1958. X    register Node
  1959. X      *node;
  1960. X  
  1961. -   register unsigned char
  1962. -     bisect,
  1963. -     id;
  1964. X    register unsigned int
  1965. X      level;
  1966. X  
  1967. X    /*
  1968. X      Initialize color description tree.
  1969. X    */
  1970. --- 281,294 ----
  1971. X    register Node
  1972. X      *node;
  1973. X  
  1974. X    register unsigned int
  1975. +     count,
  1976. +     id,
  1977. X      level;
  1978. X  
  1979. +   unsigned int
  1980. +     bisect;
  1981. X    /*
  1982. X      Initialize color description tree.
  1983. X    */
  1984. ***************
  1985. *** 232,240 ****
  1986. X    cube.node_list=(Nodes *) NULL;
  1987. X    cube.colors=0;
  1988. X    cube.free_nodes=0;
  1989. !   cube.root=InitializeNode(MaxRGB >> 1,MaxRGB >> 1,MaxRGB >> 1);
  1990. !   cube.leaf=InitializeNode(0,0,0);
  1991. !   if ((cube.root == (Node *) NULL) || (cube.leaf == (Node *) NULL))
  1992. X      {
  1993. X        Warning("unable to count colors","memory allocation failed");
  1994. X        return(0);
  1995. --- 295,302 ----
  1996. X    cube.node_list=(Nodes *) NULL;
  1997. X    cube.colors=0;
  1998. X    cube.free_nodes=0;
  1999. !   cube.root=InitializeNode(0,(MaxRGB+1) >> 1,(MaxRGB+1) >> 1,(MaxRGB+1) >> 1);
  2000. !   if (cube.root == (Node *) NULL)
  2001. X      {
  2002. X        Warning("unable to count colors","memory allocation failed");
  2003. X        return(0);
  2004. ***************
  2005. *** 245,252 ****
  2006. X      /*
  2007. X        Start at the root and proceed level by level.
  2008. X      */
  2009. X      node=cube.root;
  2010. !     for (level=1; level < MaxTreeDepth; level++)
  2011. X      {
  2012. X        id=(p->red >= node->mid_red ? 1 : 0) |
  2013. X          (p->green >= node->mid_green ? 1 : 0) << 1 |
  2014. --- 307,315 ----
  2015. X      /*
  2016. X        Start at the root and proceed level by level.
  2017. X      */
  2018. +     count=p->length+1;
  2019. X      node=cube.root;
  2020. !     for (level=1; level <= MaxTreeDepth; level++)
  2021. X      {
  2022. X        id=(p->red >= node->mid_red ? 1 : 0) |
  2023. X          (p->green >= node->mid_green ? 1 : 0) << 1 |
  2024. ***************
  2025. *** 253,263 ****
  2026. X          (p->blue >= node->mid_blue ? 1 : 0) << 2;
  2027. X        if (node->child[id] == (Node *) NULL)
  2028. X          {
  2029. !           bisect=(unsigned int) (1 << (MaxTreeDepth-level)) >> 1;
  2030. !           node->child[id]=InitializeNode(
  2031. !             node->mid_red+(id & 1 ? bisect : -bisect),
  2032. !             node->mid_green+(id & 2 ? bisect : -bisect),
  2033. !             node->mid_blue+(id & 4 ? bisect : -bisect));
  2034. X            if (node->child[id] == (Node *) NULL)
  2035. X              {
  2036. X                Warning("unable to count colors","memory allocation failed");
  2037. --- 316,334 ----
  2038. X          (p->blue >= node->mid_blue ? 1 : 0) << 2;
  2039. X        if (node->child[id] == (Node *) NULL)
  2040. X          {
  2041. !           if (level == MaxTreeDepth)
  2042. !             {
  2043. !               node->child[id]=InitializeNode(level,p->red,p->green,p->blue);
  2044. !               cube.colors++;
  2045. !             }
  2046. !           else
  2047. !             {
  2048. !               bisect=(unsigned int) (1 << (MaxTreeDepth-level)) >> 1;
  2049. !               node->child[id]=InitializeNode(level,
  2050. !                 node->mid_red+(id & 1 ? bisect : -bisect),
  2051. !                 node->mid_green+(id & 2 ? bisect : -bisect),
  2052. !                 node->mid_blue+(id & 4 ? bisect : -bisect));
  2053. !             }
  2054. X            if (node->child[id] == (Node *) NULL)
  2055. X              {
  2056. X                Warning("unable to count colors","memory allocation failed");
  2057. ***************
  2058. *** 266,281 ****
  2059. X          }
  2060. X        node=node->child[id];
  2061. X      }
  2062. !     id=(p->red >= node->mid_red ? 1 : 0) |
  2063. !       (p->green >= node->mid_green ? 1 : 0) << 1 |
  2064. !       (p->blue >= node->mid_blue ? 1 : 0) << 2;
  2065. !     if (node->child[id] == (Node *) NULL)
  2066. !       {
  2067. !         node->child[id]=cube.leaf;
  2068. !         cube.colors++;
  2069. !       }
  2070. X      p++;
  2071. X    }
  2072. X    /*
  2073. X      Release color cube tree storage.
  2074. X    */
  2075. --- 337,347 ----
  2076. X          }
  2077. X        node=node->child[id];
  2078. X      }
  2079. !     node->number_colors+=count;
  2080. X      p++;
  2081. X    }
  2082. +   if (file != (FILE *) NULL)
  2083. +     Histogram(cube.root,file);
  2084. X    /*
  2085. X      Release color cube tree storage.
  2086. X    */
  2087. diff -r -c ImageMagick/compress.c ImageMagick2.2.1/compress.c
  2088. *** ImageMagick/compress.c    Mon Dec  7 09:15:08 1992
  2089. --- ImageMagick2.2.1/compress.c    Fri Dec 18 17:07:27 1992
  2090. ***************
  2091. *** 159,165 ****
  2092. X    External declarations.
  2093. X  */
  2094. X  extern char
  2095. !   *application_name;
  2096. X  
  2097. X  /*
  2098. X  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2099. --- 159,165 ----
  2100. X    External declarations.
  2101. X  */
  2102. X  extern char
  2103. !   *client_name;
  2104. X  
  2105. X  /*
  2106. X  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2107. ***************
  2108. *** 1091,1097 ****
  2109. X            else
  2110. X              displacement=MaxHashTable-k;
  2111. X            next_pixel=False;
  2112. !           while (1)
  2113. X            {
  2114. X              k-=displacement;
  2115. X              if (k < 0)
  2116. --- 1091,1097 ----
  2117. X            else
  2118. X              displacement=MaxHashTable-k;
  2119. X            next_pixel=False;
  2120. !           for ( ; ; )
  2121. X            {
  2122. X              k-=displacement;
  2123. X              if (k < 0)
  2124. diff -r -c ImageMagick/display.c ImageMagick2.2.1/display.c
  2125. *** ImageMagick/display.c    Tue Dec  8 11:13:21 1992
  2126. --- ImageMagick2.2.1/display.c    Mon Dec 21 14:12:34 1992
  2127. ***************
  2128. *** 160,166 ****
  2129. X    Global declarations.
  2130. X  */
  2131. X  char
  2132. !   *application_name;
  2133. X  
  2134. X  /*
  2135. X    Forward declarations.
  2136. --- 160,166 ----
  2137. X    Global declarations.
  2138. X  */
  2139. X  char
  2140. !   *client_name;
  2141. X  
  2142. X  /*
  2143. X    Forward declarations.
  2144. ***************
  2145. *** 218,224 ****
  2146. X    *message,
  2147. X    *qualifier;
  2148. X  {
  2149. !   (void) fprintf(stderr,"%s: %s",application_name,message);
  2150. X    if (qualifier != (char *) NULL)
  2151. X      (void) fprintf(stderr," (%s)",qualifier);
  2152. X    (void) fprintf(stderr,".\n");
  2153. --- 218,224 ----
  2154. X    *message,
  2155. X    *qualifier;
  2156. X  {
  2157. !   (void) fprintf(stderr,"%s: %s",client_name,message);
  2158. X    if (qualifier != (char *) NULL)
  2159. X      (void) fprintf(stderr," (%s)",qualifier);
  2160. X    (void) fprintf(stderr,".\n");
  2161. ***************
  2162. *** 315,322 ****
  2163. X        (char *) NULL
  2164. X      };
  2165. X    (void) fprintf(stderr,
  2166. !     "Usage: %s [-options ...] file [ [-options ...] file ...]\n",
  2167. !     application_name);
  2168. X    (void) fprintf(stderr,"\nWhere options include: \n");
  2169. X    for (p=options; *p != (char *) NULL; p++)
  2170. X      (void) fprintf(stderr,"  %s\n",*p);
  2171. --- 315,321 ----
  2172. X        (char *) NULL
  2173. X      };
  2174. X    (void) fprintf(stderr,
  2175. !     "Usage: %s [-options ...] file [ [-options ...] file ...]\n",client_name);
  2176. X    (void) fprintf(stderr,"\nWhere options include: \n");
  2177. X    for (p=options; *p != (char *) NULL; p++)
  2178. X      (void) fprintf(stderr,"  %s\n",*p);
  2179. ***************
  2180. *** 2609,2615 ****
  2181. X      Initialize class and manager hints.
  2182. X    */
  2183. X    if (resource_info->name == (char *) NULL)
  2184. !     class_hint->res_name=application_name;
  2185. X    else
  2186. X      class_hint->res_name=resource_info->name;
  2187. X    class_hint->res_class=(char *) "ImageMagick";
  2188. --- 2608,2614 ----
  2189. X      Initialize class and manager hints.
  2190. X    */
  2191. X    if (resource_info->name == (char *) NULL)
  2192. !     class_hint->res_name=client_name;
  2193. X    else
  2194. X      class_hint->res_name=resource_info->name;
  2195. X    class_hint->res_class=(char *) "ImageMagick";
  2196. ***************
  2197. *** 3203,3208 ****
  2198. --- 3202,3215 ----
  2199. X        }
  2200. X        case KeyPress:
  2201. X        {
  2202. +         if (*state & ReconfigureImageState)
  2203. +           {
  2204. +             /*
  2205. +               No key press during image reconfiguration.
  2206. +             */
  2207. +             XBell(display,0);
  2208. +             break;
  2209. +           }
  2210. X          /*
  2211. X            Respond to a user key press.
  2212. X          */
  2213. ***************
  2214. *** 3415,3420 ****
  2215. --- 3422,3428 ----
  2216. X        /*
  2217. X          Update panning icon configuration.
  2218. X        */
  2219. +       window->pan.clip_geometry=window->image.clip_geometry;
  2220. X        XBestIconSize(display,&window->pan,displayed_image);
  2221. X        window_changes.width=window->pan.width;
  2222. X        window_changes.height=window->pan.height;
  2223. ***************
  2224. *** 3435,3440 ****
  2225. --- 3443,3449 ----
  2226. X        /*
  2227. X          Update icon configuration.
  2228. X        */
  2229. +       window->icon.clip_geometry=window->image.clip_geometry;
  2230. X        XBestIconSize(display,&window->icon,displayed_image);
  2231. X        window_changes.width=window->icon.width;
  2232. X        window_changes.height=window->icon.height;
  2233. ***************
  2234. *** 4913,4919 ****
  2235. X    /*
  2236. X      Display usage profile if there are no command line arguments.
  2237. X    */
  2238. !   application_name=(*argv);
  2239. X    if (argc < 2)
  2240. X      Usage(True);
  2241. X    /*
  2242. --- 4922,4928 ----
  2243. X    /*
  2244. X      Display usage profile if there are no command line arguments.
  2245. X    */
  2246. !   client_name=(*argv);
  2247. X    if (argc < 2)
  2248. X      Usage(True);
  2249. X    /*
  2250. ***************
  2251. *** 4967,4973 ****
  2252. X      Initialize resource database.
  2253. X    */
  2254. X    XrmInitialize();
  2255. !   XGetDefault(display,application_name,"dummy");
  2256. X    resource_database=XrmGetDatabase(display);
  2257. X    resource_value=XResourceManagerString(display);
  2258. X    if (resource_value == (char *) NULL)
  2259. --- 4976,4982 ----
  2260. X      Initialize resource database.
  2261. X    */
  2262. X    XrmInitialize();
  2263. !   XGetDefault(display,client_name,"dummy");
  2264. X    resource_database=XrmGetDatabase(display);
  2265. X    resource_value=XResourceManagerString(display);
  2266. X    if (resource_value == (char *) NULL)
  2267. ***************
  2268. *** 4977,5022 ****
  2269. X    /*
  2270. X      Get user defaults from X resource database.
  2271. X    */
  2272. !   XGetResourceInfo(resource_database,application_name,&resource_info);
  2273. !   clip_geometry=XGetResource(resource_database,application_name,"clipGeometry",
  2274. !     "ClipGeometry",(char *) NULL);
  2275. !   resource_value=XGetResource(resource_database,application_name,"compression",
  2276. !     (char *) NULL,"RunlengthEncoded");
  2277. X    if (Latin1Compare("qencoded",resource_value) == 0)
  2278. X      compression=QEncodedCompression;
  2279. X    else
  2280. X      compression=RunlengthEncodedCompression;
  2281. !   resource_value=XGetResource(resource_database,application_name,"enhance",
  2282. !     (char *) NULL,"False");
  2283. X    enhance=IsTrue(resource_value);
  2284. !   resource_value=XGetResource(resource_database,application_name,"gamma",
  2285. !     (char *) NULL,"0.0");
  2286. X    gamma=atof(resource_value);
  2287. !   resource_value=XGetResource(resource_database,application_name,"inverse",
  2288. !     (char *) NULL,"False");
  2289. X    inverse=IsTrue(resource_value);
  2290. !   resource_value=XGetResource(resource_database,application_name,"noise",
  2291. !     (char *) NULL,"False");
  2292. X    noise=IsTrue(resource_value);
  2293. !   resource_value=XGetResource(resource_database,application_name,"normalize",
  2294. !     (char *) NULL,"False");
  2295. X    normalize=IsTrue(resource_value);
  2296. !   resource_value=XGetResource(resource_database,application_name,"reflect",
  2297. !     (char *) NULL,"False");
  2298. X    reflect=IsTrue(resource_value);
  2299. !   resource_value=XGetResource(resource_database,application_name,"rotate",
  2300. !     (char *) NULL,"0");
  2301. X    degrees=atoi(resource_value);
  2302. !   scale_geometry=XGetResource(resource_database,application_name,
  2303. !     "scaleGeometry","ScaleGeometry",(char *) NULL);
  2304. !   resource_value=XGetResource(resource_database,application_name,"scene",
  2305. !     (char *) NULL,"0");
  2306. X    scene=atoi(resource_value);
  2307. !   resource_value=XGetResource(resource_database,application_name,"verbose",
  2308. !     (char *) NULL,"False");
  2309. X    verbose=IsTrue(resource_value);
  2310. !   window_id=XGetResource(resource_database,application_name,"windowId",
  2311. !     "WindowId",(char *) NULL);
  2312. X    /*
  2313. X      Parse command line.
  2314. X    */
  2315. --- 4986,5023 ----
  2316. X    /*
  2317. X      Get user defaults from X resource database.
  2318. X    */
  2319. !   XGetResourceInfo(resource_database,client_name,&resource_info);
  2320. !   clip_geometry=
  2321. !     XGetResource(resource_database,client_name,"clipGeometry",(char *) NULL);
  2322. !   resource_value=XGetResource(resource_database,client_name,"compression",
  2323. !     "RunlengthEncoded");
  2324. X    if (Latin1Compare("qencoded",resource_value) == 0)
  2325. X      compression=QEncodedCompression;
  2326. X    else
  2327. X      compression=RunlengthEncodedCompression;
  2328. !   resource_value=XGetResource(resource_database,client_name,"enhance","False");
  2329. X    enhance=IsTrue(resource_value);
  2330. !   resource_value=XGetResource(resource_database,client_name,"gamma","0.0");
  2331. X    gamma=atof(resource_value);
  2332. !   resource_value=XGetResource(resource_database,client_name,"inverse","False");
  2333. X    inverse=IsTrue(resource_value);
  2334. !   resource_value=XGetResource(resource_database,client_name,"noise","False");
  2335. X    noise=IsTrue(resource_value);
  2336. !   resource_value=
  2337. !     XGetResource(resource_database,client_name,"normalize","False");
  2338. X    normalize=IsTrue(resource_value);
  2339. !   resource_value=XGetResource(resource_database,client_name,"reflect","False");
  2340. X    reflect=IsTrue(resource_value);
  2341. !   resource_value=XGetResource(resource_database,client_name,"rotate","0");
  2342. X    degrees=atoi(resource_value);
  2343. !   scale_geometry=
  2344. !     XGetResource(resource_database,client_name,"scaleGeometry",(char *) NULL);
  2345. SHAR_EOF
  2346. true || echo 'restore of fix-01 failed'
  2347. fi
  2348. echo 'End of ImageMagick/patch01 part 1'
  2349. echo 'File fix-01 is continued in part 2'
  2350. echo 2 > _shar_seq_.tmp
  2351. exit 0
  2352. -- 
  2353. cristy@dupont.com
  2354.  
  2355. exit 0 # Just in case...
  2356.