private BufferedImage getSource(ImageResizeRequest request) {
		try {

			if (request.getSourceImage() != null) {
				return request.getSourceImage();
			}

			if (request.getSourceFileStream() != null) {
				return ImageIO.read(request.getSourceFileStream());
			}

			File sourceFile = null;
			if (request.getSourceFile() != null
					&& request.getSourceFile().canRead()) {
				sourceFile = request.getSourceFile();
			} else if (request.getSourceFilePath() != null) {
				sourceFile = new File(request.getSourceFilePath());
				if (!sourceFile.canRead()) {
					throw new ImageResizeException(
							"Cannot read source image file from provided path.");
				}
			}

			if (sourceFile == null) {
				throw new ImageResizeException(
						"Unable to get a source image file from any of the provided information.");
			}

			return ImageIO.read(sourceFile);
		} catch (IOException e) {
			throw new ImageResizeException(e.toString());
		}
	}