int sizeToUse = mCB.fullImageSizeToUse(
mCurrentPosition, offset);
Bitmap b = image.fullSizeBitmap(sizeToUse, 3 * 1024 * 1024,
- IImage.NO_ROTATE, IImage.USE_NATIVE);
+ IImage.NO_ROTATE);
if (b == null) continue;
if (mCancel) {
* @param uri
*/
public static Bitmap makeBitmap(int minSideLength, int maxNumOfPixels,
- Uri uri, ContentResolver cr, boolean useNative) {
+ Uri uri, ContentResolver cr) {
ParcelFileDescriptor input = null;
try {
input = cr.openFileDescriptor(uri, "r");
- BitmapFactory.Options options = null;
- if (useNative) {
- options = createNativeAllocOptions();
- }
return makeBitmap(minSideLength, maxNumOfPixels, uri, cr, input,
- options);
+ null);
} catch (IOException ex) {
return null;
} finally {
}
public static Bitmap makeBitmap(int minSideLength, int maxNumOfPixels,
- ParcelFileDescriptor pfd, boolean useNative) {
- BitmapFactory.Options options = null;
- if (useNative) {
- options = createNativeAllocOptions();
- }
+ ParcelFileDescriptor pfd) {
return makeBitmap(minSideLength, maxNumOfPixels, null, null, pfd,
- options);
+ null);
}
public static Bitmap makeBitmap(int minSideLength, int maxNumOfPixels,
return intent;
}
- // Returns Options that set the puregeable flag for Bitmap decode.
- public static BitmapFactory.Options createNativeAllocOptions() {
- BitmapFactory.Options options = new BitmapFactory.Options();
- options.inNativeAlloc = true;
- return options;
- }
-
public static void showFatalErrorAndFinish(
final Activity activity, String title, String message) {
DialogInterface.OnClickListener buttonListener =
public Bitmap fullSizeBitmap(int minSideLength, int maxNumberOfPixels) {
return fullSizeBitmap(minSideLength, maxNumberOfPixels,
- IImage.ROTATE_AS_NEEDED, IImage.NO_NATIVE);
+ IImage.ROTATE_AS_NEEDED);
}
public Bitmap fullSizeBitmap(int minSideLength, int maxNumberOfPixels,
- boolean rotateAsNeeded, boolean useNative) {
+ boolean rotateAsNeeded) {
Uri url = mContainer.contentUri(mId);
if (url == null) return null;
Bitmap b = Util.makeBitmap(minSideLength, maxNumberOfPixels,
- url, mContentResolver, useNative);
+ url, mContentResolver);
if (b != null && rotateAsNeeded) {
b = Util.rotate(b, getDegreesRotated());
public abstract Bitmap fullSizeBitmap(int minSideLength,
int maxNumberOfPixels);
public abstract Bitmap fullSizeBitmap(int minSideLength,
- int maxNumberOfPixels, boolean rotateAsNeeded, boolean useNative);
+ int maxNumberOfPixels, boolean rotateAsNeeded);
public abstract int getDegreesRotated();
public static final boolean ROTATE_AS_NEEDED = true;
public static final boolean NO_ROTATE = false;
- public static final boolean USE_NATIVE = true;
- public static final boolean NO_NATIVE = false;
/** Get the input stream associated with a given full size image. */
public abstract InputStream fullSizeImageData();
public Bitmap fullSizeBitmap(int minSideLength, int maxNumberOfPixels) {
return fullSizeBitmap(minSideLength, maxNumberOfPixels,
- IImage.ROTATE_AS_NEEDED, IImage.NO_NATIVE);
+ IImage.ROTATE_AS_NEEDED);
}
public Bitmap fullSizeBitmap(int minSideLength, int maxNumberOfPixels,
boolean rotateAsNeeded) {
- return fullSizeBitmap(minSideLength, maxNumberOfPixels,
- rotateAsNeeded, IImage.NO_NATIVE);
- }
-
- public Bitmap fullSizeBitmap(int minSideLength, int maxNumberOfPixels,
- boolean rotateAsNeeded, boolean useNative) {
try {
ParcelFileDescriptor pfdInput = getPFD();
Bitmap b = Util.makeBitmap(minSideLength, maxNumberOfPixels,
- pfdInput, useNative);
+ pfdInput);
return b;
} catch (Exception ex) {
Log.e(TAG, "got exception decoding bitmap ", ex);
@Override
public Bitmap fullSizeBitmap(int minSideLength, int maxNumberOfPixels,
- boolean rotateAsNeeded, boolean useNative) {
+ boolean rotateAsNeeded) {
return ThumbnailUtils.createVideoThumbnail(mDataPath);
}