-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[2.9 ACRA] crash adding bitmap to card #5513
Comments
Is there a standard process to show a user an error message ? The original problem is BitmapUtil#decodeFile, which returns null when it gets IOException, and this null is not taken into account |
There's no standard process, but see #5561 for a good example |
Cause: Lines 222 to 227 in b3d6cb3
On Exception, Anki-Android/AnkiDroid/src/main/java/com/ichi2/utils/BitmapUtil.java Lines 37 to 67 in b4361f4
We can rotate a null, but we can't compress a null. |
Our context is that we're in If we can't generate a Bitmap, then we can't do any of that. Proposal:
|
@david-allison-1 that sounds fine for user notification (the toast), when you say "add filesize to the screen" do you mean to the toast? As in "Failed to compress 0 bytes" or similar? Wording might be better if it is not technical also, e.g. "Failed to add image of 0 bytes" the card. There will be the problem of making the quantity human-friendly perhaps? Failed to add 345,456,432 bytes may not be meaningful, kilobytes might be the best tradeoff for length / precision? But implementor's choice in many ways - I'm just thinking through it out loud on the first cup of coffee |
I'd like the toast to display "Failed to compress image" and the screen to appear as such: This gives the user the choice about what to do with the image, rather than completely failing. |
I was just testing this, and the compression made my images bigger. 1.46-> 1.78 MB, so wasn't really sure how to handle that. |
Okay - what's the decision tree for the user? They see the toast and they're thinking what to do - if I'm the user I am now nervous to hit any of the buttons. If I save it is the image busted? Do I retake? Also just in general in the area cropping (or I should say - allowing the option to farm out an image edit via Intent) was really close to done #5301 |
This is one that I'm not too happy with, I'll have a think and get back to it later.
|
We may gather information via sendExceptionReport for non fatal things, and you can also record analytics events (though they have less data) if you're interested in a feature's usage in general. Let me see about getting you access to acralyzer (for crashes/exception reports) and analytics (for feature usage) so you have the ability to analyze those |
OK, had a think: frame it as a warning about increasing the collection size for now, and we can deal with this much better once opening the file in an external application is supported. New plans:
|
Sounds good |
Sometimes, the `rotateAndCompress` method could fail, causing a crash. Instead, we return the uncompressed image, and display both the file size and a warning that some images may require compression. We do this, rather than displaying an error, as it's easier for a user to take action. We unconditionally display the file size as it's a useful attribute.
* NF: BitmapUtil - Dispose Resources on failure * Fix #5513 - Don't crash if we can't compress images Sometimes, the `rotateAndCompress` method could fail, causing a crash. Instead, we return the uncompressed image, and display both the file size and a warning that some images may require compression. We do this, rather than displaying an error, as it's easier for a user to take action. We unconditionally display the file size as it's a useful attribute. * Add Crash Analytics for Compression failure
* NF: BitmapUtil - Dispose Resources on failure * Fix #5513 - Don't crash if we can't compress images Sometimes, the `rotateAndCompress` method could fail, causing a crash. Instead, we return the uncompressed image, and display both the file size and a warning that some images may require compression. We do this, rather than displaying an error, as it's easier for a user to take action. We unconditionally display the file size as it's a useful attribute. * Add Crash Analytics for Compression failure
https://couchdb.ankidroid.org/acralyzer/_design/acralyzer/index.html#/report-details/47c1cab0-f57c-4162-aa09-f09d416bd11b
The text was updated successfully, but these errors were encountered: