[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] fenfire/org/fenfire/util GLSpanner.java MipzipC...
From: |
Tuomas J. Lukka |
Subject: |
[Gzz-commits] fenfire/org/fenfire/util GLSpanner.java MipzipC... |
Date: |
Tue, 22 Apr 2003 15:44:55 -0400 |
CVSROOT: /cvsroot/fenfire
Module name: fenfire
Changes by: Tuomas J. Lukka <address@hidden> 03/04/22 15:44:54
Modified files:
org/fenfire/util: GLSpanner.java MipzipCache.java
Log message:
compiles
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/util/GLSpanner.java.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/util/MipzipCache.java.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
Patches:
Index: fenfire/org/fenfire/util/GLSpanner.java
diff -u fenfire/org/fenfire/util/GLSpanner.java:1.5
fenfire/org/fenfire/util/GLSpanner.java:1.6
--- fenfire/org/fenfire/util/GLSpanner.java:1.5 Tue Apr 22 15:40:35 2003
+++ fenfire/org/fenfire/util/GLSpanner.java Tue Apr 22 15:44:54 2003
@@ -137,15 +137,16 @@
h = d.height;
MipzipLoader l;
-
- String path = MipzipCache.getPageFiles(sb)[page];
+ String path = "XXX";
try {
+ path = MipzipCache.getPageFiles(sb)[page];
+
l = new MipzipLoader(new File(path));
} catch(IOException e) {
e.printStackTrace();
throw new Error("MipzipLoader threw '" + e + "' for " +
- f);
+ path);
}
Dimension largest = l.getLevelSize(0);
x1 = d.width / (float)largest.width;
Index: fenfire/org/fenfire/util/MipzipCache.java
diff -u fenfire/org/fenfire/util/MipzipCache.java:1.2
fenfire/org/fenfire/util/MipzipCache.java:1.3
--- fenfire/org/fenfire/util/MipzipCache.java:1.2 Tue Apr 22 15:40:35 2003
+++ fenfire/org/fenfire/util/MipzipCache.java Tue Apr 22 15:44:54 2003
@@ -18,29 +18,12 @@
*/
public class MipzipCache {
- int RESOLUTION = 200;
+ static int RESOLUTION = 200;
- File tmp = new File("../tmpimg");
+ static File tmp = new File("../tmpimg");
static PythonInterpreter interp;
- PyObject conv1;
- if(contentType.equals("application/postscript")) {
- conv1 = interp.get("ps");
- } else {
- conv1 = interp.get("pdf");
- }
- File dsc;
- try {
- dsc = File.createTempFile("dsc","dsc");
- } catch(Exception e) {
- throw new Error(""+e);
- }
- PyObject res = conv1.__call__(new PyObject[] {
- new PyString(alph.getBlockFile(this).getFilename()),
- new PyString(dsc.getPath()),
- });
- if(! res.__nonzero__())
static private String hide(String s) {
StringBuffer res = new StringBuffer();
@@ -55,7 +38,8 @@
return res.toString();
}
- public String[] getPageFiles(ScrollBlock pages) {
+ static public String[] getPageFiles(ScrollBlock pages)
+ throws java.io.FileNotFoundException {
String ct = pages.getContentType();
if(! (ct.equals("application/pdf") ||
ct.equals("application/postscript")))
@@ -63,14 +47,14 @@
int n = ((Span1D)(pages.getCurrent())).length();
- String prefix = hide(pages.getId()) + "-" + RESOLUTION + "-";
+ String prefix = hide(pages.getID()) + "-" + RESOLUTION + "-";
String[] tmppaths = new String[n];
String[] paths = new String[n];
boolean exist = true;
for(int i=0; i<n; i++) {
String base = prefix + (i+1);
- File f = new File(tmp, base).getPath();
+ File f = new File(tmp, base);
paths[i] = f.getPath();
tmppaths[i] = new File(tmp, "tmp"+base).getPath();
if(!f.exists()) exist = false;
@@ -94,7 +78,7 @@
new PyString(f.getFilename()),
new PyString(new File(tmp, "tmp"+prefix).getPath()),
new PyInteger(RESOLUTION)
- }))
+ }).__nonzero__())
throw new Error("Conversion unsuccessful");
for(int i=0; i<n; i++) {