Code example for InputStream

Methods: decodeStream

0
		return decodingOptions;
	} 
 
	protected Bitmap decodeStream(InputStream imageStream, Options decodingOptions) throws IOException {
		try { 
			return BitmapFactory.decodeStream(imageStream, null, decodingOptions);
		} finally { 
			IoUtils.closeSilently(imageStream);
		} 
	} 
 
	protected Bitmap considerExactScaleAndOrientaiton(Bitmap subsampledBitmap, ImageDecodingInfo decodingInfo, int rotation, boolean flipHorizontal) {
		Matrix m = new Matrix();
		// Scale to exact size if need 
		ImageScaleType scaleType = decodingInfo.getImageScaleType();
		if (scaleType == ImageScaleType.EXACTLY || scaleType == ImageScaleType.EXACTLY_STRETCHED) {
			ImageSize srcSize = new ImageSize(subsampledBitmap.getWidth(), subsampledBitmap.getHeight(), rotation);
			float scale = ImageSizeUtils.computeImageScale(srcSize, decodingInfo.getTargetSize(), decodingInfo.getViewScaleType(), scaleType == ImageScaleType.EXACTLY_STRETCHED);
			if (Float.compare(scale, 1f) != 0) {
				m.setScale(scale, scale);