python-3.xlibgphoto2

GPhoto2 - get focal length and sensor size directly from the camera


Is it possible to get focal length and/or sensor size directly from the camera using GPhoto2?

I've tried to look for it in camera object and in file info, but to no avail. I also know I can get/set some parameters (speed, aperture and so on) using config. Focal length is not one of them for obvious reasons, but I was wondering if camera knows its current value. Same for the sensor size, of course it's not configurable, but I assume camera would know it internally.

Why do I need this? I need to know focal length in pixels and I intend to compute it from focal length, sensor size and image resolution.


Solution

  • The camera config can include read-only parameters, which might include focal length for some cameras. (The whole config is very camera dependent.)

    The only solution I can suggest is to take a photo, copy it from the camera (or even just copy the first few kilobytes) then get the info you want from the photo's Exif data.