Package org.apache.fop.image.analyser

Examples of org.apache.fop.image.analyser.ImageReader


        FopImage imageObject = (FopImage)m_urlMap.get(absoluteURL.toString());
        if (imageObject != null)
            return imageObject;

            // If not, check image type
        ImageReader imgReader = null;
        try {
            if (imgIS == null) {
                imgIS = absoluteURL.openStream();
            }
            imgReader = ImageReaderFactory.Make(absoluteURL.toExternalForm(),
                                                imgIS);
        } catch (Exception e) {
            throw new FopImageException("Error while recovering Image Informations ("
                                        + absoluteURL.toString() + ") : "
                                        + e.getMessage());
        }
        finally {
            if (imgIS != null) {
                try {
                    imgIS.close();
                } catch (IOException e) {}
            }
        }
        if (imgReader == null)
            throw new FopImageException("No ImageReader for this type of image ("
                                        + absoluteURL.toString() + ")");
            // Associate mime-type to FopImage class
        String imgMimeType = imgReader.getMimeType();
        String imgClassName = null;
        if ("image/gif".equals(imgMimeType)) {
            imgClassName = "org.apache.fop.image.GifJpegImage";
            // imgClassName = "org.apache.fop.image.JAIImage";
        } else if ("image/jpeg".equals(imgMimeType)) {
View Full Code Here


        FopImage imageObject = (FopImage)m_urlMap.get(absoluteURL.toString());
        if (imageObject != null)
            return imageObject;

            // If not, check image type
        ImageReader imgReader = null;
        try {
            if (imgIS == null) {
                imgIS = absoluteURL.openStream();
            }
            imgReader = ImageReaderFactory.Make(absoluteURL.toExternalForm(),
                                                imgIS);
        } catch (Exception e) {
            throw new FopImageException("Error while recovering Image Informations ("
                                        + absoluteURL.toString() + ") : "
                                        + e.getMessage());
        }
        finally {
            if (imgIS != null) {
                try {
                    imgIS.close();
                } catch (IOException e) {}
            }
        }
        if (imgReader == null)
            throw new FopImageException("No ImageReader for this type of image ("
                                        + absoluteURL.toString() + ")");
            // Associate mime-type to FopImage class
        String imgMimeType = imgReader.getMimeType();
        String imgClassName = null;
        if ("image/gif".equals(imgMimeType)) {
            imgClassName = "org.apache.fop.image.GifImage";
            // imgClassName = "org.apache.fop.image.JAIImage";
        } else if ("image/jpeg".equals(imgMimeType)) {
View Full Code Here

                                            + e_context.getMessage());
            }
        }

        // If not, check image type
        ImageReader imgReader = null;
        try {
            if (imgIS == null) {
                imgIS = absoluteURL.openStream();
            }
            imgReader = ImageReaderFactory.Make(absoluteURL.toExternalForm(),
                                                imgIS);
        } catch (Exception e) {
            throw new FopImageException("Error while recovering Image Informations ("
                                        + absoluteURL.toString() + ") : "
                                        + e.getMessage());
        }
        finally {
            if (imgIS != null) {
                try {
                    imgIS.close();
                } catch (IOException e) {}
            }
        }
        if (imgReader == null)
            throw new FopImageException("No ImageReader for this type of image ("
                                        + absoluteURL.toString() + ")");
            // Associate mime-type to FopImage class
        String imgMimeType = imgReader.getMimeType();
        String imgClassName = null;
        if ("image/gif".equals(imgMimeType)) {
            imgClassName = "org.apache.fop.image.GifImage";
        } else if ("image/jpeg".equals(imgMimeType)) {
            imgClassName = "org.apache.fop.image.JpegImage";
View Full Code Here

      (FopImage) m_urlMap.get(absoluteURL.toString());
    if (imageObject != null)
      return imageObject;

    // If not, check image type
    ImageReader imgReader = null;
    InputStream imgIS = null;
    try {
      imgIS = absoluteURL.openStream();
      imgReader = ImageReaderFactory.Make(imgIS);
    } catch (Exception e) {
      throw new FopImageException(
        "Error while recovering Image Informations (" +
        absoluteURL.toString() + ") : " + e.getMessage());
    } finally {
      if (imgIS != null) {
        try {imgIS.close();} catch (IOException e) {}
      }
    }
    if (imgReader == null)
      throw new FopImageException("No ImageReader for this type of image (" +
                                  absoluteURL.toString() + ")");
    // Associate mime-type to FopImage class
    String imgMimeType = imgReader.getMimeType();
    String imgClassName = null;
    if ("image/gif".equals(imgMimeType)) {
      imgClassName = "org.apache.fop.image.GifJpegImage";
//      imgClassName = "org.apache.fop.image.JAIImage";
    } else if ("image/jpeg".equals(imgMimeType)) {
View Full Code Here

                                            + e_context.getMessage());
            }
        }

            // If not, check image type
        ImageReader imgReader = null;
        try {
            if (imgIS == null) {
                imgIS = absoluteURL.openStream();
            }
            imgReader = ImageReaderFactory.Make(absoluteURL.toExternalForm(),
                                                imgIS);
        } catch (Exception e) {
            throw new FopImageException("Error while recovering Image Informations ("
                                        + absoluteURL.toString() + ") : "
                                        + e.getMessage());
        }
        finally {
            if (imgIS != null) {
                try {
                    imgIS.close();
                } catch (IOException e) {}
            }
        }
        if (imgReader == null)
            throw new FopImageException("No ImageReader for this type of image ("
                                        + absoluteURL.toString() + ")");
            // Associate mime-type to FopImage class
        String imgMimeType = imgReader.getMimeType();
        String imgClassName = null;
        if ("image/gif".equals(imgMimeType)) {
            imgClassName = "org.apache.fop.image.GifImage";
            // imgClassName = "org.apache.fop.image.JAIImage";
        } else if ("image/jpeg".equals(imgMimeType)) {
View Full Code Here

          (FopImage) m_urlMap.get(absoluteURL.toString());
        if (imageObject != null)
            return imageObject;

        // If not, check image type
        ImageReader imgReader = null;
        try {
            if (imgIS == null) {
                imgIS = absoluteURL.openStream();
            }
            imgReader = ImageReaderFactory.Make(absoluteURL.toExternalForm(), imgIS);
        } catch (Exception e) {
            throw new FopImageException(
              "Error while recovering Image Informations (" +
              absoluteURL.toString() + ") : " + e.getMessage());
        }
        finally { if (imgIS != null) {
                  try {
                          imgIS.close();
                  } catch (IOException e) {}
                  }
            } if (imgReader == null)
            throw new FopImageException(
              "No ImageReader for this type of image (" +
              absoluteURL.toString() + ")");
        // Associate mime-type to FopImage class
        String imgMimeType = imgReader.getMimeType();
        String imgClassName = null;
        if ("image/gif".equals(imgMimeType)) {
            imgClassName = "org.apache.fop.image.GifJpegImage";
            //      imgClassName = "org.apache.fop.image.JAIImage";
        } else if ("image/jpeg".equals(imgMimeType)) {
View Full Code Here

      (FopImage) m_urlMap.get(absoluteURL.toString());
    if (imageObject != null)
      return imageObject;

    // If not, check image type
    ImageReader imgReader = null;
    InputStream imgIS = null;
    try {
      imgIS = absoluteURL.openStream();
      imgReader = ImageReaderFactory.Make(imgIS);
    } catch (Exception e) {
      throw new FopImageException(
        "Error while recovering Image Informations (" +
        absoluteURL.toString() + ") : " + e.getMessage());
    } finally {
      try {imgIS.close();} catch (IOException e) {}
    }
    if (imgReader == null)
      throw new FopImageException("No ImageReader for this type of image (" +
                                  absoluteURL.toString() + ")");
    // Associate mime-type to FopImage class
    String imgMimeType = imgReader.getMimeType();
    String imgClassName = null;
    if ("image/gif".equals(imgMimeType)) {
      imgClassName = "org.apache.fop.image.GifJpegImage";
    } else if ("image/jpeg".equals(imgMimeType)) {
      imgClassName = "org.apache.fop.image.GifJpegImage";
View Full Code Here

TOP

Related Classes of org.apache.fop.image.analyser.ImageReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.