~ubuntu-branches/ubuntu/hardy/texmacs/hardy

« back to all changes in this revision

Viewing changes to TeXmacs/progs/convert/images/init-images.scm

  • Committer: Bazaar Package Importer
  • Author(s): Ralf Treinen
  • Date: 2004-04-19 20:34:00 UTC
  • Revision ID: james.westby@ubuntu.com-20040419203400-g4e34ih0315wcn8v
Tags: upstream-1.0.3-R2
ImportĀ upstreamĀ versionĀ 1.0.3-R2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
3
;;
 
4
;; MODULE      : init-images.scm
 
5
;; DESCRIPTION : setup image converters
 
6
;; COPYRIGHT   : (C) 2003  Joris van der Hoeven
 
7
;;
 
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.
 
12
;;
 
13
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
14
 
 
15
(texmacs-module (convert images init-images))
 
16
 
 
17
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
18
;; Graphical document and geometric image formats
 
19
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
20
 
 
21
(define-format postscript
 
22
  (:name "Postscript")
 
23
  (:suffix "ps" "eps"))
 
24
 
 
25
(define-format pdf
 
26
  (:name "Pdf")
 
27
  (:suffix "pdf"))
 
28
 
 
29
(converter pdf-file postscript-file
 
30
  (:shell "pdf2ps" from to))
 
31
 
 
32
(converter postscript-file pdf-file
 
33
  (:shell "ps2pdf" from to))
 
34
 
 
35
(define-format xfig
 
36
  (:name "Xfig")
 
37
  (:suffix "fig"))
 
38
 
 
39
(converter xfig-file postscript-file
 
40
  (:shell "fig2ps" from to))
 
41
 
 
42
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
43
;; Bitmap image formats
 
44
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
45
 
 
46
(define-format xpm
 
47
  (:name "Xpm")
 
48
  (:suffix "xpm"))
 
49
 
 
50
(converter xpm-file ppm-file
 
51
  (:require (url-exists-in-path? "xpmtoppm"))
 
52
  (:shell "xpmtoppm" from ">" to))
 
53
 
 
54
(define-format jpeg
 
55
  (:name "Jpeg")
 
56
  (:suffix "jpg" "jpeg"))
 
57
 
 
58
(converter jpeg-file pnm-file
 
59
  (:shell "djpeg" "-pnm" from ">" to))
 
60
 
 
61
(define-format ppm
 
62
  (:name "Ppm")
 
63
  (:suffix "ppm"))
 
64
 
 
65
(converter ppm-file gif-file
 
66
  (:shell "ppmtogif" from ">" to))
 
67
 
 
68
(define-format gif
 
69
  (:name "Gif")
 
70
  (:suffix "gif"))
 
71
 
 
72
(converter gif-file pnm-file
 
73
  (:shell "giftopnm" from "| cat >" to))
 
74
 
 
75
(define-format png
 
76
  (:name "Png")
 
77
  (:suffix "png"))
 
78
 
 
79
(converter png-file pnm-file
 
80
  (:shell "pngtopnm" from ">" to))
 
81
 
 
82
(define-format pnm
 
83
  (:name "Pnm")
 
84
  (:suffix "pnm"))
 
85
 
 
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))))))