src/jpm/dg/MediaActivity.java
/**
	 * Loads a full-size Bitmap from memory.
	 * @param sourceUri The data source.
	 * @return An unscaled Bitmap.
	 */
Loads a full-size Bitmap from memory.
@param sourceUri The data source.
@return An unscaled Bitmap.
Loads a full - size Bitmap from memory . @param sourceUri The data source . @return An unscaled Bitmap .
public Bitmap loadFullImage(Uri sourceUri) {
		InputStream s = null;
		try {
			s = getContentResolver().openInputStream(sourceUri);
			final BufferedInputStream is = new BufferedInputStream(s, 32 * 1024);
			final Options decodeBitmapOptions = new Options();
			final Options decodeBoundsOptions = new Options();
			decodeBoundsOptions.inJustDecodeBounds = true;
			is.mark(32 * 1024);
			BitmapFactory.decodeStream(is, null, decodeBoundsOptions);
			is.reset();
			final int width = decodeBoundsOptions.outWidth;
			final int height = decodeBoundsOptions.outHeight;
			if ((width * height) > Util.PIXEL_LIMIT) {
				Dialogs.showErrorDialog(this, Dialogs.IMAGE_TOO_LARGE);
			} else {
				decodeBitmapOptions.inSampleSize = 1;
				return BitmapFactory
						.decodeStream(is, null, decodeBitmapOptions);
			}
		} catch (Throwable t) {
			t.printStackTrace();
			if(t.getMessage().contains("Mark")) {
				Dialogs.showErrorDialog(this, Dialogs.IMAGE_TOO_LARGE);
			} else {
				Dialogs.showErrorDialog(this, Dialogs.NO_DATA);
			}
		} finally {
			if (s != null)
				try {
					s.close();
				} catch (Exception e) {
				}
		}
		return null;
	}
public Bitmap loadFullImage ( Uri sourceUri ) { InputStream s = null ; try { s = getContentResolver ( ) . openInputStream ( sourceUri ) ; final BufferedInputStream is = new BufferedInputStream ( s , 32 * 1024 ) ; final Options decodeBitmapOptions = new Options ( ) ; final Options decodeBoundsOptions = new Options ( ) ; decodeBoundsOptions . inJustDecodeBounds = true ; is . mark ( 32 * 1024 ) ; BitmapFactory . decodeStream ( is , null , decodeBoundsOptions ) ; is . reset ( ) ; final int width = decodeBoundsOptions . outWidth ; final int height = decodeBoundsOptions . outHeight ; if ( ( width * height ) > Util . PIXEL_LIMIT ) { Dialogs . showErrorDialog ( this , Dialogs . IMAGE_TOO_LARGE ) ; } else { decodeBitmapOptions . inSampleSize = 1 ; return BitmapFactory . decodeStream ( is , null , decodeBitmapOptions ) ; } } catch ( Throwable t ) { t . printStackTrace ( ) ; if ( t . getMessage ( ) . contains ( "Mark" ) ) { Dialogs . showErrorDialog ( this , Dialogs . IMAGE_TOO_LARGE ) ; } else { Dialogs . showErrorDialog ( this , Dialogs . NO_DATA ) ; } } finally { if ( s != null ) try { s . close ( ) ; } catch ( Exception e ) { } } return null ; }
Loads a full-size Bitmap from memory.
Loads a full - size Bitmap from memory .