| java.lang.Object org.jamwiki.utils.ImageUtil
ImageUtil | public class ImageUtil (Code) | | Utility methods for readding images from disk, saving images to disk,
resizing images, and returning information about images such as width and
height.
|
Method Summary | |
public static WikiImage | initializeImage(WikiFile wikiFile, int maxDimension) Given a virtualWiki and WikiFIle that correspond to an existing image,
return the WikiImage object. | public static boolean | isImage(File file) Given a File object, determine if the file is an image or if it is some
other type of file. |
initializeImage | public static WikiImage initializeImage(WikiFile wikiFile, int maxDimension) throws Exception(Code) | | Given a virtualWiki and WikiFIle that correspond to an existing image,
return the WikiImage object. In addition, an optional maxDimension
parameter may be specified, in which case a resized version of the image
may be created.
Parameters: wikiFile - Given a WikiFile object, use it to initialize aWikiImage object. Parameters: maxDimension - The maximum width or height for the initializedWikiImage object. Setting this value to 0 or less will cause thevalue to be ignored. An initialized WikiImage object. throws: Exception - Thrown if an error occurs while initializing theWikiImage object. |
isImage | public static boolean isImage(File file) throws Exception(Code) | | Given a File object, determine if the file is an image or if it is some
other type of file. Note that this method will read in the entire file,
so there are performance implications for large files.
Parameters: file - The File object for the file that is being examined. Returns true if the file is an image object. throws: Exception - Thrown if any error occurs while reading the file. |
|
|