Format photo exposure bias value
ClosedPublic

Authored by astippich on Jun 15 2019, 11:05 AM.

Details

Summary

Format the photo exposure bias value in EV units
and in steps of thirds when applicable

CCBUG: 343273

Diff Detail

Repository
R286 KFileMetaData
Branch
exposure_bias
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 12865
Build 12883: arc lint + arc unit
astippich created this revision.Jun 15 2019, 11:05 AM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptJun 15 2019, 11:05 AM
Restricted Application added subscribers: Baloo, kde-frameworks-devel. · View Herald Transcript
astippich requested review of this revision.Jun 15 2019, 11:05 AM

exposure bias seems mostly to be in steps of 1/3 according to https://www.geofflawrence.com/exposure_compensation.html

Many cameras can be switched to 1/2 EV steps.

src/formatstrings.cpp
189

this is probably not working for e.g. "-1 1/3"

Many cameras can be switched to 1/2 EV steps.

Damn ;) do you know any other values? In case not, I would add this case in a loop and stupidly try everything

Many cameras can be switched to 1/2 EV steps.

Damn ;) do you know any other values? In case not, I would add this case in a loop and stupidly try everything

I think with 1/2 and 1/3 you have covered 99.9% of the cameras.

You can quantize to 1/6, and if the fractional part is in {2,3,4}, use the "%1 %2/%3" format.

To avoid the if() { if() { if() { }}} cascade, you may use a nested function (lambda) for the default case (format as double), and do an early return.

How about integral/fractional instead of wholeNumber/remainder?

bruns added inline comments.Jun 15 2019, 12:01 PM
src/formatstrings.cpp
183

You obviously multiply here ...

astippich added inline comments.Jun 15 2019, 12:21 PM
src/formatstrings.cpp
183

dividing by one third is multiplying by three :)

astippich updated this revision to Diff 59873.Jun 15 2019, 12:49 PM
  • cover 1/2 case
astippich marked an inline comment as done.Jun 15 2019, 12:51 PM
astippich updated this revision to Diff 59874.Jun 15 2019, 12:52 PM
  • remove unneeded newline
bruns added inline comments.Jun 15 2019, 1:24 PM
src/formatstrings.cpp
193

no need for else here, you return. dito below

astippich updated this revision to Diff 59875.Jun 15 2019, 1:34 PM
  • remove unnecessary else

friendly ping, would be great to get this in before the string freeze

bruns accepted this revision.Jun 21 2019, 9:28 AM
This revision is now accepted and ready to land.Jun 21 2019, 9:28 AM
This revision was automatically updated to reflect the committed changes.