-
-
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.10Alpha54: Crash when pressing "edit field" for img field #5856
Comments
Check database and check media didn't solve the problem. I downgraded to 2.10alpha53 and now everything is working again. |
|
@david-allison-1 What do you think how complicated it is to have a "rename" feature there? |
Assuming one image? More annoying than you'd expect, we'd need to synchronise both the file rename, and the saving of the note, and rollback if one fails. That being said, if it's on the backlog, it's visible and it's possible |
Testing a fix for this now, should be a PR in 10 |
When loading an existing image, we performed the image load before we had created all elements of the UI. This caused issues. We fix this by splitting UI creation and initialisation logic
createUI has `@SuppressLint("NewApi")` due to camera permissioning, but it masked a bug in calling setBackground with lower API levels
* Fix #5856 - Image Preview Crash When loading an existing image, we performed the image load before we had created all elements of the UI. This caused issues. We fix this by splitting UI creation and initialisation logic * Fix #5856 - Fix API Errors createUI has `@SuppressLint("NewApi")` due to camera permissioning, but it masked a bug in calling setBackground with lower API levels * Added Unit Tests Very basic right now, but there's a lot of value in ensuring that a screen can be created with no errors.
2.10alpha55 is out with the fix, as soon as Google is done processing it and starts delivery... |
Problem solved in 2.10alpha56. Thanks @david-allison-1 BTW showing the image size in the editing field screen is really useful! |
No worries! Good to hear! To be honest: the functionality is almost accidental. It's the best way to tell someone the impact if there's a problem with "compress & resize", but it might as well be enabled for all images. |
@david-allison-1 what do you mean with "compress & resize"? Is that a new feature in development? |
It's been a feature since 2014: 7c0811c. Whenever someone takes a picture with the camera, we try to silently compress and resize it so it doesn't take up too much disk space. Sadly, this occasionally fails: #5513/#5849 (hence the bugfix and displaying the size). |
@david-allison-1 Interesting. I never realized that AnkiDroid silently compresses camera images. What is the threshold? I can insert pictures from camera that are 2.9MB without getting a notice. And if the code is already there, why not make "resize and compress" as button available for all pictures? Sometimes I insert downloaded images >100kB which I find quite large. So I have to manually resize and compress those pictures with my photo app. |
@Anthropos888 it rotates and compresses no matter what - every image: 7c0811c#diff-6106bd1e14ca30faa16f8622fd8cf92eR186 First it loads into a 1920 max width bitmap (which will shrink some images just to start), then it attempts to compress as by converting to PNG. The problem is that the PNG compression is lossless and some things (like image data, frequently) doesn't compress well, so the clipping is useful but the compression may not work great. There's a PR to allow AnkiDroid to store the inbound image you took (from camera or gallery) and then call the application configured on the system for cropping so users can really make a size difference by cutting images down, but it's not merged yet #5301 |
* Fix #5856 - Image Preview Crash When loading an existing image, we performed the image load before we had created all elements of the UI. This caused issues. We fix this by splitting UI creation and initialisation logic * Fix #5856 - Fix API Errors createUI has `@SuppressLint("NewApi")` due to camera permissioning, but it masked a bug in calling setBackground with lower API levels * Added Unit Tests Very basic right now, but there's a lot of value in ensuring that a screen can be created with no errors.
Reproduction Steps
Expected Result
The edit field screen with the image is shown
Actual Result
(Soft) Crash. A report is being sent and AnkiDroid returns to the reviewer.
I think I'll downgrade to alpha53 for now since I can't view/change images anymore from the edit card screen.
Debug info
AnkiDroid Version = 2.10alpha54
Android Version = 9
ACRA UUID = 1f29f610-893a-403f-83d5-25a26ba97fe0
Research
Enter an [ x ] character to confirm the points below:
[X ] I have read the support page and am reporting a bug or enhancement request specific to AnkiDroid
[ x] I have checked the manual and the FAQ and could not find a solution to my issue
[ x ] I have searched for similar existing issues here and on the user forum
The text was updated successfully, but these errors were encountered: