32 |
import org.python.util.*; |
import org.python.util.*; |
33 |
import org.python.core.*; |
import org.python.core.*; |
34 |
import java.awt.image.*; |
import java.awt.image.*; |
35 |
import java.awt.Dimension.*; |
import java.awt.Dimension; |
36 |
import java.io.*; |
import java.io.*; |
37 |
import java.util.*; |
import java.util.*; |
38 |
|
|
128 |
float inchWidth = maxw / 72.0f; |
float inchWidth = maxw / 72.0f; |
129 |
float inchHeight = maxh / 72.0f; |
float inchHeight = maxh / 72.0f; |
130 |
|
|
131 |
// int hreso = MAXTEXSIZE |
int xreso = (int)(MAXTEXSIZE / inchWidth); |
132 |
|
int yreso = (int)(MAXTEXSIZE / inchHeight); |
133 |
|
|
134 |
String prefix = protectChars(pages.getID()) + "-" + RESOLUTION + "-"; |
String resolution = ""+xreso+"x"+yreso; |
135 |
|
|
136 |
|
String prefix = protectChars(pages.getID()) + "-" + resolution + "-"; |
137 |
|
|
138 |
String[] tmppaths = new String[n]; |
String[] tmppaths = new String[n]; |
139 |
String[] paths = new String[n]; |
String[] paths = new String[n]; |
163 |
if(! interp.get("cv").__call__(new PyObject[] { |
if(! interp.get("cv").__call__(new PyObject[] { |
164 |
new PyString(f.getFilename()), |
new PyString(f.getFilename()), |
165 |
new PyString(new File(tmp(), "tmp"+prefix).getPath()), |
new PyString(new File(tmp(), "tmp"+prefix).getPath()), |
166 |
new PyInteger(RESOLUTION) |
new PyString(resolution) |
167 |
}).__nonzero__()) |
}).__nonzero__()) |
168 |
throw new Error("Conversion unsuccessful"); |
throw new Error("Conversion unsuccessful"); |
169 |
|
|
170 |
for(int i=0; i<n; i++) { |
for(int i=0; i<n; i++) { |
171 |
interp.get("mz").__call__(new PyObject[] { |
interp.get("mz").__call__(new PyObject[] { |
172 |
new PyString(tmppaths[i]), |
new PyString(tmppaths[i]), |
173 |
new PyString(paths[i]) |
new PyString(paths[i]), |
174 |
|
new PyInteger(MAXTEXSIZE), |
175 |
|
new PyInteger(MAXTEXSIZE) |
176 |
}); |
}); |
177 |
(new File(tmppaths[i])).delete(); |
(new File(tmppaths[i])).delete(); |
178 |
} |
} |