Skip to content
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

exposure: use locale independent float conversion #113

Merged
merged 2 commits into from Oct 14, 2023

Conversation

simonschmeisser
Copy link

std::to_string (and the inverse std::stod) will use the active c locale. Qt apps do this somewhere deep inside. This resulted in the step size being printed as "0,166", which was parsed by the consumer as "0" on systems using , as decimal separator (eg LANG=de)

I could also copy the conversion functions from here https://github.com/ros-planning/moveit/blob/master/moveit_core/utils/src/lexical_casts.cpp (with a suitable namespace) and use them, what do you prefer?

@simonschmeisser
Copy link
Author

Full parameter output before was (linebreaks added for clarity):

antibanding-values=off,50hz,60hz,auto;
preview-fps-range-values=(15,15),(15,30),(30,30),(15,60),(60,60),(15,120),(120,120);
preview-frame-rate=30;
min-exposure-compensation=-12;
max-exposure-compensation=12;
exposure-compensation-step=0,166667;
focus-mode-values=infinity,auto,macro,continuous-video,continuous-picture;
effect-values=none,mono,negative,solarize,sepia,posterize,aqua,blackboard,whiteboard;
scene-mode-values=auto,auto,action,portrait,landscape,night,night-portrait,theatre,beach,snow,sunset,fireworks,sports,party,candlelight,hdr;
whitebalance-values=auto,incandescent,fluorescent,warm-fluorescent,daylight,cloudy-daylight,twilight,shade,;
max-num-focus-areas0;
max-num-metering-areas1;
auto-exposure-lock-supported=true;
auto-exposure-lock=false;
auto-whitebalance-lock-supported=true;
auto-whitebalance-lock=false;
flash-mode-values=off,auto,on,torch;
picture-size-values=4000x3000,3840x2160,3264x2448,3200x2400,2976x2976,2688x1512,2592x1944,2048x1536,1920x1440,1920x1080,1600x1200,1440x1080,1280x96

@simonschmeisser
Copy link
Author

There is another remaining issue: sailfish-camera remembers the exposure correction but does not initially set it. So if I set it to -2, then close and restart the app it will display -2 but the image will be at 0. Can be "fixed" by moving around the slider but looks unprofessional

@simonschmeisser
Copy link
Author

Not sure if you're notified automatically so ping @mlehtima

@mlehtima mlehtima merged commit 7940c60 into sailfishos:camera2 Oct 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants