15 |
"ab1", "ab2" and "ab3". Note: 1-based. |
"ab1", "ab2" and "ab3". Note: 1-based. |
16 |
""" |
""" |
17 |
print "Processing ",file |
print "Processing ",file |
18 |
l = os.popen("file -i -b %(file)s" % locals()).readlines()[0] |
# Don't check right now-- no os.popen in Jython |
19 |
l = l.rstrip().lstrip() |
#l = os.popen("file -i -b %(file)s" % locals()).readlines()[0] |
20 |
print "'%(l)s'" % locals() |
#l = l.rstrip().lstrip() |
21 |
|
#print "'%(l)s'" % locals() |
22 |
|
|
23 |
if l != "application/pdf" and l != "application/postscript": |
#if l != "application/pdf" and l != "application/postscript": |
24 |
print "Unknown - ignoring" |
# print "Unknown - ignoring" |
25 |
return 0 |
# return 0 |
26 |
|
|
27 |
cmdline = "gs -dBATCH -dNOPAUSE -sDEVICE=png256 -r%(res)s -sOutputFile=%(prefix)%%d %(file)s" % locals() |
cmdline = "gs -dBATCH -dNOPAUSE -sDEVICE=png256 -r%(resolution)s -sOutputFile=%(prefix)%%d %(file)s" % locals() |
28 |
print "RUNNING ",cmdline |
print "RUNNING ",cmdline |
29 |
res = os.system(cmdline) |
res = os.system(cmdline) |
30 |
if res: |
if res: |