Closed mikehardy closed 1 day ago
Note that rendering images with WebView does not really fix the "users loading huge images" problem(s), it has different problems with huge images.
So I think this package of fixes is a good thing to have in 2.19.x if reviewers agree
Niceeee one! Just woke up but this is great
Purpose / Description
Attempting to test:
17035
Reproduced and fixed:
17378
Noticed that the number format on the "image too large, want to crop?" dialog was mathematically incorrect and formatted wrong.
Also noticed that if the image was too large you really just couldn't save it at all even if you were a grown adult and you knew what you were doing
Finally noticed that if you have an image file that is finally large enough (I needed a really really big image) then you'll crash both when adding via shortcut and from image picker. Same line of code though, so I handled that and it should work now.
Fixes
Fixes:
17378
Approach
Carefully catch the exception thrown, but also clear out the dirty intermediate state in the image widget so we recover
How Has This Been Tested?
I manually verified that when I add a really large image it has the size correctly displayed now, and I can save it if I really want to.
ankidroid_add_large_image.webm
I also manually verified that when I add a stupendously large image that crashed (I reproduced the crash...) it now succeeds
no-crash-on-huge-file.webm
Learning (optional, can help others)
Yak shaves always Crash fixes - even easy ones - are a little subtle
Checklist
Please, go through these checks before submitting the PR.