File: pic2png_eps.py

package info (click to toggle)
lyx 1.1.6fix4-2
  • links: PTS
  • area: contrib
  • in suites: woody
  • size: 26,136 kB
  • ctags: 13,679
  • sloc: cpp: 93,591; sh: 9,563; ansic: 8,253; perl: 3,489; makefile: 1,332; tcl: 163; sed: 150; python: 112; yacc: 38
file content (23 lines) | stat: -rw-r--r-- 539 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/python
# This script converts a raster format picture into a PNG and EPS file

import sys
import os
import os.path

if len(sys.argv) > 2:
	pars = sys.argv[2]

pid = os.fork()
if pid == 0:
	os.execvp("convert", ["convert", pars, sys.argv[1], os.path.splitext(sys.argv[1])[0] + ".eps"])
	print "convert did not work"
	os.exit(1)
os.wait()

pid = os.fork()
if pid == 0:
	os.execvp("convert", ["convert", pars, sys.argv[1], os.path.splitext(sys.argv[1])[0] + ".png"])
	print "convert did not work second time"
	os.exit(1)
os.wait()