Created
October 21, 2016 14:06
-
-
Save CMingTseng/36bf1ebaac957037e5c6196070b2d944 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mageRequest imageRequest = ImageRequestBuilder | |
.newBuilderWithSource(mImageCaptureUri) | |
.setAutoRotateEnabled(true) | |
.build(); | |
ImagePipeline imagePipeline = Fresco.getImagePipeline(); | |
final DataSource<CloseableReference<CloseableImage>> | |
dataSource = imagePipeline.fetchDecodedImage(imageRequest, this); | |
dataSource.subscribe(new BaseBitmapDataSubscriber() { | |
@Override | |
public void onNewResultImpl(@Nullable Bitmap bitmap) { | |
if (dataSource.isFinished() && bitmap != null){ | |
Log.d("Bitmap","has come"); | |
bmp = Bitmap.createBitmap(bitmap); | |
dataSource.close(); | |
} | |
} | |
@Override | |
public void onFailureImpl(DataSource dataSource) { | |
if (dataSource != null) { | |
dataSource.close(); | |
} | |
} | |
}, CallerThreadExecutor.getInstance()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment