comparison servlet/src/digilib/image/DocuImageImpl.java @ 122:a32e8c80e2f2

Servlet Version 1.10b1 - more intelligent handling of resolutions - different handling of mo=lores
author robcast
date Wed, 11 Jun 2003 22:51:28 +0200
parents 997ba69afb81
children 04ad64b2137a
comparison
equal deleted inserted replaced
121:1ac2c5c6ec0e 122:a32e8c80e2f2
18 18
19 */ 19 */
20 20
21 package digilib.image; 21 package digilib.image;
22 22
23 import java.awt.Dimension;
24 import java.awt.Rectangle; 23 import java.awt.Rectangle;
25 import java.io.File; 24 import java.io.File;
26 import java.io.IOException;
27 25
28 import digilib.Utils; 26 import digilib.Utils;
29 import digilib.io.DocuFile;
30 import digilib.io.FileOpException; 27 import digilib.io.FileOpException;
31 import digilib.io.FileOps;
32 28
33 /** Simple abstract implementation of the <code>DocuImage</code> interface. 29 /** Simple abstract implementation of the <code>DocuImage</code> interface.
34 * 30 *
35 * This implementation provides basic functionality for the utility methods like 31 * This implementation provides basic functionality for the utility methods like
36 * <code>SetUtils</code>, and <code>getKnownFileTypes</code>. Image methods like 32 * <code>SetUtils</code>, and <code>getKnownFileTypes</code>. Image methods like
121 setQuality(qual); 117 setQuality(qual);
122 crop(x_off, y_off, width, height); 118 crop(x_off, y_off, width, height);
123 scale(scale); 119 scale(scale);
124 } 120 }
125 121
126 /* this is a rather stupid implementation, eventually loading the whole file. */
127 public boolean checkFile(DocuFile f) throws IOException {
128 loadImage(f.getFile());
129 int w = getWidth();
130 int h = getHeight();
131 Dimension s = new Dimension(w, h);
132 f.setSize(s);
133 String m = FileOps.mimeForFile(f.getFile());
134 mimeType = m;
135 f.setMimetype(m);
136 return true;
137 }
138
139 public String getMimetype() { 122 public String getMimetype() {
140 return mimeType; 123 return mimeType;
141 } 124 }
142 125
143 public void rotate(double angle) throws ImageOpException { 126 public void rotate(double angle) throws ImageOpException {