Mercurial > hg > digilib-old
comparison servlet/src/digilib/image/ImageLoaderDocuImage.java @ 821:6c752969f9e8 stream
more tries and catches...
| author | robcast |
|---|---|
| date | Tue, 22 Feb 2011 20:08:27 +0100 |
| parents | a23c4c15a6a8 |
| children | f210731dc6cc |
comparison
equal
deleted
inserted
replaced
| 820:dc8cda290f2f | 821:6c752969f9e8 |
|---|---|
| 199 Iterator<ImageReader> readers; | 199 Iterator<ImageReader> readers; |
| 200 String mt = null; | 200 String mt = null; |
| 201 if (input.hasMimetype()) { | 201 if (input.hasMimetype()) { |
| 202 // check hasMimetype first or we might get into a loop | 202 // check hasMimetype first or we might get into a loop |
| 203 mt = input.getMimetype(); | 203 mt = input.getMimetype(); |
| 204 } else { | |
| 205 // try file extension | |
| 206 mt = FileOps.mimeForFile(input.getFile()); | |
| 204 } | 207 } |
| 205 if (mt == null) { | 208 if (mt == null) { |
| 206 logger.debug("No mime-type. Trying automagic."); | 209 logger.debug("No mime-type. Trying automagic."); |
| 207 readers = ImageIO.getImageReaders(istream); | 210 readers = ImageIO.getImageReaders(istream); |
| 208 } else { | 211 } else { |
