aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/image/analyser/ImageReaderFactory.java
diff options
context:
space:
mode:
authoreschaeffer <eschaeffer@unknown>2000-12-18 11:21:33 +0000
committereschaeffer <eschaeffer@unknown>2000-12-18 11:21:33 +0000
commit31744f7be507be43ee60a0bd290f027cf535dc16 (patch)
treeb5a574c5598714e06c8c24556593570ea0b9b0d3 /src/org/apache/fop/image/analyser/ImageReaderFactory.java
parent60b6ef8e236a228f24f9eedff1d6a39c8b03dae8 (diff)
downloadxmlgraphics-fop-31744f7be507be43ee60a0bd290f027cf535dc16.tar.gz
xmlgraphics-fop-31744f7be507be43ee60a0bd290f027cf535dc16.zip
Add TIFFReader support
PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193905 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/image/analyser/ImageReaderFactory.java')
-rw-r--r--src/org/apache/fop/image/analyser/ImageReaderFactory.java95
1 files changed, 48 insertions, 47 deletions
diff --git a/src/org/apache/fop/image/analyser/ImageReaderFactory.java b/src/org/apache/fop/image/analyser/ImageReaderFactory.java
index d811eacb6..5593be778 100644
--- a/src/org/apache/fop/image/analyser/ImageReaderFactory.java
+++ b/src/org/apache/fop/image/analyser/ImageReaderFactory.java
@@ -1,27 +1,27 @@
/*
============================================================================
- The Apache Software License, Version 1.1
+ The Apache Software License, Version 1.1
============================================================================
- Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
+ Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without modifica-
tion, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
+ this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
3. The end-user documentation included with the redistribution, if any, must
- include the following acknowledgment: "This product includes software
- developed by the Apache Software Foundation (http://www.apache.org/)."
- Alternately, this acknowledgment may appear in the software itself, if
- and wherever such third-party acknowledgments normally appear.
+ include the following acknowledgment: "This product includes software
+ developed by the Apache Software Foundation (http://www.apache.org/)."
+ Alternately, this acknowledgment may appear in the software itself, if
+ and wherever such third-party acknowledgments normally appear.
4. The names "Fop" and "Apache Software Foundation" must not be used to
- endorse or promote products derived from this software without prior
- written permission. For written permission, please contact
- apache@apache.org.
+ endorse or promote products derived from this software without prior
+ written permission. For written permission, please contact
+ apache@apache.org.
5. Products derived from this software may not be called "Apache", nor may
- "Apache" appear in their name, without prior written permission of the
- Apache Software Foundation.
+ "Apache" appear in their name, without prior written permission of the
+ Apache Software Foundation.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
@@ -56,41 +56,42 @@ import org.apache.fop.image.FopImageException;
* @version 1.0
*/
public class ImageReaderFactory {
- static protected Vector formats = null;
+ static protected Vector formats = null;
- /**
- * ImageReader maker.
- * @param in image input stream
- * @return ImageReader object
- * @exception FopImageException an error occured during creation or
- * image type is not supported
- */
- static public ImageReader Make(InputStream in)
- throws FopImageException {
+ /**
+ * ImageReader maker.
+ * @param in image input stream
+ * @return ImageReader object
+ * @exception FopImageException an error occured during creation or
+ * image type is not supported
+ */
+ static public ImageReader Make(InputStream in)
+ throws FopImageException {
- // need to use a config file and remove static methods
- formats = new Vector();
- formats.addElement(new JPEGReader());
- formats.addElement(new BMPReader());
- formats.addElement(new GIFReader());
- formats.addElement(new PNGReader());
- formats.addElement(new SVGReader());
- //
+ // need to use a config file and remove static methods
+ formats = new Vector();
+ formats.addElement(new JPEGReader());
+ formats.addElement(new BMPReader());
+ formats.addElement(new GIFReader());
+ formats.addElement(new PNGReader());
+ formats.addElement(new TIFFReader());
+ formats.addElement(new SVGReader());
+ //
- ImageReader reader;
- BufferedInputStream bis = new BufferedInputStream(in);
- Enumeration itr = formats.elements();
- try {
- while (itr.hasMoreElements()) {
- reader = (ImageReader) itr.nextElement();
- if (reader.verifySignature(bis)) {
- return reader;
- }
- }
- } catch (IOException ex) {
- throw new FopImageException(ex.getMessage());
- }
- return null;
- }
+ ImageReader reader;
+ BufferedInputStream bis = new BufferedInputStream(in);
+ Enumeration itr = formats.elements();
+ try {
+ while (itr.hasMoreElements()) {
+ reader = (ImageReader) itr.nextElement();
+ if (reader.verifySignature(bis)) {
+ return reader;
+ }
+ }
+ } catch (IOException ex) {
+ throw new FopImageException(ex.getMessage());
+ }
+ return null;
+ }
}