public class ImageRenderUtils
extends java.lang.Object
Constructor and Description |
---|
ImageRenderUtils() |
Modifier and Type | Method and Description |
---|---|
static ImageDimensions |
dimensionsForImage(javax.imageio.stream.ImageInputStream inputStream)
Helper class that uses an
ImageReader to determine the width and height of an image. |
static ImageDimensions |
dimensionsForImage(java.io.InputStream is) |
static void |
writePngToStream(java.awt.image.BufferedImage image,
javax.servlet.http.HttpServletResponse response)
Write the
image (expected to be a PNG image) to the servlet output stream of the response. |
public static ImageDimensions dimensionsForImage(javax.imageio.stream.ImageInputStream inputStream) throws java.io.IOException
ImageReader
to determine the width and height of an image.
Doesn't rasterize the whole image and works well even with very large images (e.g. 15,000 x 15,000 px).java.io.IOException
public static ImageDimensions dimensionsForImage(java.io.InputStream is) throws java.io.IOException
java.io.IOException
public static void writePngToStream(java.awt.image.BufferedImage image, javax.servlet.http.HttpServletResponse response) throws java.io.IOException
image
(expected to be a PNG image) to the servlet output stream of the response.
This method will flush and close the servlet output stream.
image
- The PNG that will be written to the servlet responseresponse
- HttpServletResponsejava.io.IOException
- if the image cannot be written, or if it cannot be flushed.ResponseOutputStreamFilter
Copyright © 2003-2014 Atlassian. All Rights Reserved.