Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

Sending to intent goes wrong #21

Closed
catalin-florescu opened this issue Dec 11, 2015 · 3 comments
Closed

Sending to intent goes wrong #21

catalin-florescu opened this issue Dec 11, 2015 · 3 comments
Labels

Comments

@catalin-florescu
Copy link

After crop, if i send picture via intent like in sample with Picasso, most of the times does nothing because file is corrupted or other causes. I made an AsyncTask with weak reference to load bitmap. I set image to crop, first time resulted bitmap is null. Second time bitmap is decoded successful. Is decoding when he wants. I do something wrong or is some bug? I followed the sample at first time and it isn't work at all.

@eveliotc
Copy link
Contributor

@Cataalinn can you make sure you are loading file once flushing to disk has finished? it sounds like that operation has not completed when you start your other activity.

In our sample we use rxjava to observe when flushing is completed, and then we start the other Activity, please make sure you use as similar approach when using extensions or alternatively you can use just use Bitmap result = cropView.crop(); to obtain the Bitmap and save it to disk at your convenience.

@catalin-florescu
Copy link
Author

@eveliotc what do you mean once Flushing to disk has finish?

@eveliotc
Copy link
Contributor

@Cataalinn it means when writing all the bits that compose your image format into the file has completed. If you read the file before that it will likely be empty or partial (corrupted). For your information here is how extensions write to file.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants