asalamon74 / pktriggercord

Remote control for Pentax DSLR cameras
http://pktriggercord.melda.info
GNU Lesser General Public License v3.0
103 stars 38 forks source link

Fixed set_exposure_mode #45

Closed blemasle closed 4 years ago

blemasle commented 4 years ago

This PR fixes the ability to set the exposure mode for cameras that need a conversion step.

As per the code

// most of the cameras require this exposure mode conversion step pslr_gui_exposure_mode_t exposure_mode_conversion( pslr_exposure_mode_t exp ) {

But set_exposure_mode didn't call that conversion step! As a result, setting the exposure_mode from the command line does not work correctly. For instance, --exposure_mode=M actually set the exposure mode to X (because PSLR_EXPOSURE_MODE_M == PSLR_GUI_EXPOSURE_MODE_X== 8).

pktriggercord-cli.exe --drive_mode=Single --exposure_mode=M --iso=800 --shutter_speed="1/100" --output_file="test.dng"

exiftool.exe test-0000.dng -ExposureMode -PictureMode
Exposure Mode                   : Manual
Picture Mode                    : Flash X-Sync Speed AE; 1/3 EV steps
Exposure Time                   : 1/180

After the fix

exiftool.exe test-0000.dng -ExposureMode -PictureMode -ExposureTime
Exposure Mode                   : Manual
Picture Mode                    : Manual, Off-Auto-Aperture; 1/3 EV steps
Exposure Time                   : 1/100

I can finally use both my K-5 and K-5 II in bulb or manual mode directly from the command line! 😄

asalamon74 commented 4 years ago

Thanks for the pull request.

I tested it with my K-x and K-70 and it's not working for those models.

(It's a bit strange, but if I put my K-70 in P mode it still accepts the --shutter_speed options (with or without this patch) so it's possible to specify the shutter speed.)

What mode do you set the exposure mode dial on the camera?

Since it does not effect K-x and K-70, but improves this for K-5 and K-5 II I think I'll still commit this.

blemasle commented 4 years ago

Hello.

I was in a custom User mode, that normally uses Bulb (B). Setting the exposure mode only seems to work on user modes or when setting Mon the dial.

So to properly tests this fix on your K-70 :

With the fix, you should see something like

Exposure Mode                   : Auto
Picture Mode                    : Aperture Priority, Off-Auto-Aperture; 1/3 EV steps

whereas the shot you've made without the fix is stuck to manual exposure

Exposure Mode                   : Manual
Picture Mode                    : Manual, Off-Auto-Aperture; 1/3 EV steps

Being able to set the exposure time is just a side effect of the fact that exposure mode wasn't set properly before.

Hopes that made things clearer. If not, feel free to ask again and I'll try to answer quicker than this time ;)

asalamon74 commented 4 years ago

It was not working in M mode, but changing to user mode (U1) did the tricks. Thanks.

asalamon74 commented 4 years ago

Merged, thanks again for the patch.