@Test public void testScale() { BufferedImage uut = ImageScaler.scale(img, ImageSizePreset.FULL.getSize()); assertEquals(ImageSizePreset.FULL.getSize().getWidth(), uut.getWidth()); assertEquals(ImageSizePreset.FULL.getSize().getHeight(), uut.getHeight()); uut = ImageScaler.scale(img, ImageSizePreset.ICON.getSize()); assertEquals(ImageSizePreset.ICON.getSize().getWidth(), uut.getWidth()); assertEquals(ImageSizePreset.ICON.getSize().getHeight(), uut.getHeight()); uut = ImageScaler.scale(img, 2.2); assertEquals((int) (widthBefore * 2.2), uut.getWidth()); assertEquals((int) (heightBefore * 2.2), uut.getHeight()); uut = ImageScaler.scale(img, 0.33); assertEquals((int) (widthBefore * 0.33), uut.getWidth()); assertEquals((int) (heightBefore * 0.33), uut.getHeight()); uut = ImageScaler.scale(img, 1.0); assertEquals(widthBefore, uut.getWidth()); assertEquals(heightBefore, uut.getHeight()); uut = ImageScaler.scale(img, 0.001); assertEquals(1, uut.getWidth()); assertEquals(1, uut.getHeight()); uut = ImageScaler.scale(img, 1.0, 2.5); assertEquals(widthBefore, uut.getWidth()); assertEquals((int) (heightBefore * 2.5), uut.getHeight()); uut = ImageScaler.scale(img, 2.5, 1.0); assertEquals((int) (widthBefore * 2.5), uut.getWidth()); assertEquals(heightBefore, uut.getHeight()); uut = ImageScaler.scale(img, 0.5, 4.0); assertEquals((int) (widthBefore * 0.5), uut.getWidth()); assertEquals((int) (heightBefore * 4.0), uut.getHeight()); uut = ImageScaler.scale(img, 4.0, 0.5); assertEquals((int) (widthBefore * 4.0), uut.getWidth()); assertEquals((int) (heightBefore * 0.5), uut.getHeight()); uut = ImageScaler.scale(img, 807); assertEquals(807, uut.getWidth()); assertEquals(807, uut.getHeight()); uut = ImageScaler.scale(img, 122); assertEquals(122, uut.getWidth()); assertEquals(122, uut.getHeight()); uut = ImageScaler.scale(img, widthBefore); assertEquals(widthBefore, uut.getWidth()); assertEquals(widthBefore, uut.getHeight()); uut = ImageScaler.scale(img, widthBefore, 654); assertEquals(widthBefore, uut.getWidth()); assertEquals(654, uut.getHeight()); uut = ImageScaler.scale(img, 654, heightBefore); assertEquals(654, uut.getWidth()); assertEquals(heightBefore, uut.getHeight()); uut = ImageScaler.scale(img, 111, 555); assertEquals(111, uut.getWidth()); assertEquals(555, uut.getHeight()); uut = ImageScaler.scale(img, 555, 111); assertEquals(555, uut.getWidth()); assertEquals(111, uut.getHeight()); uut = ImageScaler.scale(img, 1, 1); assertEquals(1, uut.getWidth()); assertEquals(1, uut.getHeight()); }
public static BufferedImage scale(BufferedImage image, ImageSize size) { if (size == null) { log.error("The supplied image size is null."); throw new NullPointerException("The supplied image size is null."); } return scale(image, size.getWidth(), size.getHeight()); }
ImageScaler { public static BufferedImage scale(BufferedImage image, ImageSize size) { if (size == null) { log.error("The supplied image size is null."); throw new NullPointerException("The supplied image size is null."); } return scale(image, size.getWidth(), size.getHeight()); } }
ImageScaler { public static BufferedImage scale(BufferedImage image, ImageSize size) { if (size == null) { log.error("The supplied image size is null."); throw new NullPointerException("The supplied image size is null."); } return scale(image, size.getWidth(), size.getHeight()); } private  ImageScaler(); }
ImageScaler { public static BufferedImage scale(BufferedImage image, ImageSize size) { if (size == null) { log.error("The supplied image size is null."); throw new NullPointerException("The supplied image size is null."); } return scale(image, size.getWidth(), size.getHeight()); } private  ImageScaler(); static BufferedImage scale(BufferedImage image, ImageSize size); static BufferedImage scale(BufferedImage image, double scalingFactor); static BufferedImage scale(BufferedImage image, double widthScaling,
      double heightScaling); static BufferedImage scale(BufferedImage image, int size); static BufferedImage scale(BufferedImage image, int width, int height); }
ImageScaler { public static BufferedImage scale(BufferedImage image, ImageSize size) { if (size == null) { log.error("The supplied image size is null."); throw new NullPointerException("The supplied image size is null."); } return scale(image, size.getWidth(), size.getHeight()); } private  ImageScaler(); static BufferedImage scale(BufferedImage image, ImageSize size); static BufferedImage scale(BufferedImage image, double scalingFactor); static BufferedImage scale(BufferedImage image, double widthScaling,
      double heightScaling); static BufferedImage scale(BufferedImage image, int size); static BufferedImage scale(BufferedImage image, int width, int height);  }