Package com.core.util.image
Class SImageResizer
- java.lang.Object
-
- com.core.util.image.SImageResizer
-
public class SImageResizer extends java.lang.Object
- Author:
- Sokkheang.huo
-
-
Constructor Summary
Constructors Constructor Description SImageResizer()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
resize(java.lang.String inputImagePath, java.lang.String outputImagePath, double percent)
Resizes an image by a percentage of original size (proportional).static void
resize(java.lang.String inputImagePath, java.lang.String outputImagePath, int scaledWidth, int scaledHeight)
Resizes an image to a absolute width and height (the image may not be proportional)
-
-
-
Method Detail
-
resize
public static void resize(java.lang.String inputImagePath, java.lang.String outputImagePath, int scaledWidth, int scaledHeight) throws java.io.IOException
Resizes an image to a absolute width and height (the image may not be proportional)- Parameters:
inputImagePath
- Path of the original imageoutputImagePath
- Path to save the resized imagescaledWidth
- absolute width in pixelsscaledHeight
- absolute height in pixels- Throws:
java.io.IOException
-
resize
public static void resize(java.lang.String inputImagePath, java.lang.String outputImagePath, double percent) throws java.io.IOException
Resizes an image by a percentage of original size (proportional).- Parameters:
inputImagePath
- Path of the original imageoutputImagePath
- Path to save the resized imagepercent
- a double number specifies percentage of the output image over the input image.- Throws:
java.io.IOException
-
-