Add optional maximum photo resolution cap - #669
Conversation
|
Tested it out and it works for me! Thank you for pursuing this! (I'm from #505) I've found two issues
Maybe this means a dropdown makes more sense? A dropdown also makes it easier to change when a user say wants it back to native for a few specific pictures (and then will change it back).
|
Add a "Max resolution" setting (More settings) that caps the long edge of captured photos to a configurable number of pixels. 0 (the default) keeps the current behaviour of using the largest available resolution for the chosen aspect ratio. The cap is applied via a CameraX ResolutionStrategy (FALLBACK_RULE_CLOSEST_LOWER_THEN_HIGHER) alongside the existing aspect ratio strategy, so it works independently of the aspect ratio and across devices. Useful for keeping documentation-style photos small. The cap and the existing "Use highest photo resolution" option are mutually exclusive: enabling one disables and clears the other in the UI, and the cap takes precedence if both are somehow set. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
8bc2ab1 to
dbe81ff
Compare
Thank you so much for testing this, i really appreciate it! Both fixed: "Max resolution" and "Use highest photo resolution" are now mutually |
|
Consider adding some before/after UI screens/videos if you're serious about getting this more attention. Personally, I never expected anything beyond the dropdown style resolution picker that is prevalent in so many other camera apps. Not sure anything beyond or in addition to that will be considered from a UX standpoint. Also, why the "Max" qualifier? Is it not just the plain resolution that we're picking/setting? Is there a min also? It seems to imply there's at least a "Minimum" resolution setting (or others) that is configurable which wouldn't make sense. Max, min, and everything in between are just general resolutions a user can pick. Similarly, the 0 = Actual max resolution feels unintuitive, no? I wouldn't expect the free-form value to also act as a toggle. I'd expect a toggle "Use max camera resolution" that would disable the free-form field and then that value to be an integer > 0. But as I said, best bet is a dropdown with standard assigned values. |
The main reason I went with a numeric field over fixed presets: absolute values like 2560/1920/1080 etc. assume that those sizes are meaningful on every device, but the supported capture sizes vary a lot between sensors. Again: the size is applied at capture time via CameraX, nothing is re-scaled after shot and it needs no image-processing library, so it stays dependency-free and lightweight - therefore i stayed with a setting thats compatible with every device. |
25fd41a to
db39c2d
Compare
Adds an optional "Max resolution" setting (More settings) that caps the long
edge of captured photos to a configurable number of pixels. 0 (the default)
keeps the current behaviour of picking the largest available resolution for the
chosen aspect ratio, so nothing changes for existing users unless they opt in.
Implements the maximum-resolution setting requested in #591 and #505.
Motivation: we'd love to use this app in the field (simple, no bloat), but for
documentation photos an 8-12 MP file has no more value to us than a ~1 MP one -
it just costs storage and upload. A resolution cap solves that predictably.
Two things that should make this an easy fit:
No new dependency and no post-processing. Instead of resizing after capture,
it tells CameraX to capture at a lower resolution directly - a
ResolutionStrategy (FALLBACK_RULE_CLOSEST_LOWER_THEN_HIGHER) added to the
existing ResolutionSelector, next to the aspect ratio strategy. This addresses
the concern in Would you be open to someone implementing a maximum resolution setting? #591 about pulling in an image processing library.
It's the same mechanism QR scan mode already uses to limit its resolution
(noted in Camera mode - allow resolution setting #505), just applied to image capture - so it's not a new concept.
Because it caps the long edge (not the aspect ratio), it works independently of
4:3 / 16:9 and across devices, unlike switching to 16:9 which only reduces
resolution on some sensors. On a test device a 1920px cap produced 1920x1440
(4:3) / 1920x1080 (16:9) instead of 4096x3072 / 4096x2304.
I went with a free pixel value to be most flexible but could also switch it to a fixed dropdown
(Off / 2560 / 1920 / 1080) if you'd prefer that.