org.apache.shindig.gadgets.rewrite.image
Class BasicImageRewriter
java.lang.Object
org.apache.shindig.gadgets.rewrite.image.BasicImageRewriter
- All Implemented Interfaces:
- ResponseRewriter
public class BasicImageRewriter
- extends Object
- implements ResponseRewriter
Rewrite images to more efficiently compress their content. Can output to a different format file
for better efficiency.
Security Note: Uses the Sanselan library to parse image content and metadata to avoid security
issues in the ImageIO library. Uses ImageIO for output.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BasicImageRewriter
@Inject
public BasicImageRewriter(OptimizerConfig config)
rewrite
public void rewrite(HttpRequest request,
HttpResponseBuilder response)
- Specified by:
rewrite in interface ResponseRewriter
readImage
protected BufferedImage readImage(org.apache.sanselan.ImageFormat imageFormat,
HttpResponseBuilder response)
throws org.apache.sanselan.ImageReadException,
IOException
- Throws:
org.apache.sanselan.ImageReadException
IOException
readBmp
protected BufferedImage readBmp(HttpResponseBuilder response)
throws org.apache.sanselan.ImageReadException,
IOException
- Throws:
org.apache.sanselan.ImageReadException
IOException
readPng
protected BufferedImage readPng(HttpResponseBuilder response)
throws org.apache.sanselan.ImageReadException,
IOException
- Throws:
org.apache.sanselan.ImageReadException
IOException
readGif
protected BufferedImage readGif(HttpResponseBuilder response)
throws org.apache.sanselan.ImageReadException,
IOException
- Throws:
org.apache.sanselan.ImageReadException
IOException
readJpeg
protected BufferedImage readJpeg(HttpResponseBuilder response)
throws org.apache.sanselan.ImageReadException,
IOException
- Throws:
org.apache.sanselan.ImageReadException
IOException
Copyright © 2007-2012. All Rights Reserved.