ImreC-Wr/src/main/java/p/lodz/pl/adi/utils/ImageResizer.java
public InputStreamE resize(InputStream is, int sizeMultiplier, String imageType) throws ResizingException {
        try {
            ensureImageType(imageType);
            ensureSizeMultiplier(sizeMultiplier);

            BufferedImage srcImage = ImageIO.read(is);
            if (srcImage == null) {
                throw new ResizingException("srcImage == null");
            }

            double sizeMultiplier2 = sizeMultiplier / 100.0;
            int newWidth = (int) (srcImage.getWidth() * sizeMultiplier2);
            int newHeight = (int) (srcImage.getHeight() * sizeMultiplier2);

            BufferedImage scaledImage = Scalr.resize(srcImage, newWidth, newHeight);

            return makeResult(scaledImage, imageType);

        } catch (IOException e) {
            throw new ResizingException(e);
        }
    }
/**
     * @throws ResizingException if resizing failed due to IO
     * @throws IllegalArgumentException if resizing failed due to arguments
     */
@throws ResizingException if resizing failed due to IO
@throws IllegalArgumentException if resizing failed due to arguments
@throws ResizingException if resizing failed due to IO @throws IllegalArgumentException if resizing failed due to arguments
public InputStreamE resize(InputStream is, int sizeMultiplier, String imageType) throws ResizingException {
        try {
            ensureImageType(imageType);
            ensureSizeMultiplier(sizeMultiplier);
            BufferedImage srcImage = ImageIO.read(is);
            if (srcImage == null) {
                throw new ResizingException("srcImage == null");
            }
            double sizeMultiplier2 = sizeMultiplier / 100.0;
            int newWidth = (int) (srcImage.getWidth() * sizeMultiplier2);
            int newHeight = (int) (srcImage.getHeight() * sizeMultiplier2);
            BufferedImage scaledImage = Scalr.resize(srcImage, newWidth, newHeight);
            return makeResult(scaledImage, imageType);
        } catch (IOException e) {
            throw new ResizingException(e);
        }
    }
public InputStreamE resize ( InputStream is , int sizeMultiplier , String imageType ) throws ResizingException { try { ensureImageType ( imageType ) ; ensureSizeMultiplier ( sizeMultiplier ) ; BufferedImage srcImage = ImageIO . read ( is ) ; if ( srcImage == null ) { throw new ResizingException ( "srcImage == null" ) ; } double sizeMultiplier2 = sizeMultiplier / 100.0 ; int newWidth = ( int ) ( srcImage . getWidth ( ) * sizeMultiplier2 ) ; int newHeight = ( int ) ( srcImage . getHeight ( ) * sizeMultiplier2 ) ; BufferedImage scaledImage = Scalr . resize ( srcImage , newWidth , newHeight ) ; return makeResult ( scaledImage , imageType ) ; } catch ( IOException e ) { throw new ResizingException ( e ) ; } }
@throws ResizingException if resizing failed due to IO
 @throws IllegalArgumentException if resizing failed due to arguments
@throws ResizingException if resizing failed due to IO @throws IllegalArgumentException if resizing failed due to arguments