Skip to content
Snippets Groups Projects
Commit f23fb96a authored by felmer's avatar felmer
Browse files

LMS-1231 Javadoc added

SVN: 13004
parent 2bb2bce5
No related branches found
No related tags found
No related merge requests found
...@@ -25,12 +25,18 @@ import javax.media.jai.JAI; ...@@ -25,12 +25,18 @@ import javax.media.jai.JAI;
import javax.media.jai.PlanarImage; import javax.media.jai.PlanarImage;
/** /**
* * Utility function on images.
* *
* @author Franz-Josef Elmer * @author Franz-Josef Elmer
*/ */
public class ImageUtil public class ImageUtil
{ {
/**
* Loads an image from specified file. Supported file formats are GIF, JPG, PNG, and TIFF.
*
* @throws IllegalArgumentException if either the file does not exist or it isn't a valid image
* file.
*/
public static BufferedImage loadImage(File file) public static BufferedImage loadImage(File file)
{ {
if (file.exists() == false) if (file.exists() == false)
...@@ -47,6 +53,12 @@ public class ImageUtil ...@@ -47,6 +53,12 @@ public class ImageUtil
} }
} }
/**
* Creates a thumbnail from the specified image by preserving the aspect ratio.
*
* @param maxWidth Maximum width of the thumbnail.
* @param maxHeight Maximum height of the thumbnail.
*/
public static BufferedImage createThumbnail(BufferedImage image, int maxWidth, int maxHeight) public static BufferedImage createThumbnail(BufferedImage image, int maxWidth, int maxHeight)
{ {
int width = image.getWidth(); int width = image.getWidth();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment