public static Bitmap getAndConvert(InputStream input, int scale, boolean higherQuality) {
    	try {
			BufferedImage image = ImageIO.read(input);
			int width;
			int height;
			
			if(scale >= 0) {
				width = image.getWidth() * scale;
				height = image.getHeight() * scale;
			} else {
				width = image.getWidth() / (scale * -1);
				height = image.getHeight() / (scale * -1);
			}
			BufferedImage finalBuffer = getScaledInstance(image, width, height, RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR, higherQuality);
			
			Bitmap picture = convert(finalBuffer);
			
			input.close();
			image.flush();
			finalBuffer.flush();
			
			return picture;
		
		} catch(IOException e) {
			System.out.println("Error getting the image");
			System.exit(1);
			e.printStackTrace();
		}
		
		return null;
    }