home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sources / misc / 4227 < prev    next >
Encoding:
Text File  |  1992-12-27  |  75.3 KB  |  2,393 lines

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