2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4
;; MODULE : init-images.scm
5
;; DESCRIPTION : setup image converters
6
;; COPYRIGHT : (C) 2003 Joris van der Hoeven
8
;; This software falls under the GNU general public license and comes WITHOUT
9
;; ANY WARRANTY WHATSOEVER. See the file $TEXMACS_PATH/LICENSE for details.
10
;; If you don't have this file, write to the Free Software Foundation, Inc.,
11
;; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
13
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
15
(texmacs-module (convert images init-images))
17
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
18
;; Graphical document and geometric image formats
19
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
21
(define-format postscript
29
(converter pdf-file postscript-file
30
(:shell "pdf2ps" from to))
32
(converter postscript-file pdf-file
33
(:shell "ps2pdf" from to))
39
(converter xfig-file postscript-file
40
(:shell "fig2ps" from to))
42
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
43
;; Bitmap image formats
44
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
50
(converter xpm-file ppm-file
51
(:require (url-exists-in-path? "xpmtoppm"))
52
(:shell "xpmtoppm" from ">" to))
56
(:suffix "jpg" "jpeg"))
58
(converter jpeg-file pnm-file
59
(:shell "djpeg" "-pnm" from ">" to))
65
(converter ppm-file gif-file
66
(:shell "ppmtogif" from ">" to))
72
(converter gif-file pnm-file
73
(:shell "giftopnm" from "| cat >" to))
79
(converter png-file pnm-file
80
(:shell "pngtopnm" from ">" to))
86
(converter pnm-file postscript-document
87
(:require (url-exists-in-path? "pnmtops"))
88
(:function (lambda (file)
89
(eval-system (string-append "pnmtops -noturn "
90
(url->string file))))))