Skip to content

Commit e1c3409

Browse files
Pre-commit
1 parent dd07f28 commit e1c3409

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

imgparse/parser.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,9 @@ def focal_length_meters(self) -> float:
236236

237237
def focal_length_pixels(self, use_calibrated_focal_length: bool = False) -> float:
238238
"""Get the focal length (in pixels) of the sensor that took the image."""
239-
def get_focal_length():
240-
"""Helper to get focal length and its unit."""
239+
240+
def _get_focal_length() -> tuple[float, bool]:
241+
"""Get either the calibrated focal length or the exif focal length."""
241242
if use_calibrated_focal_length:
242243
try:
243244
return self.calibrated_focal_length()
@@ -247,7 +248,7 @@ def get_focal_length():
247248
)
248249
return self.focal_length_meters(), False
249250

250-
fl, is_in_pixels = get_focal_length()
251+
fl, is_in_pixels = _get_focal_length()
251252
if not is_in_pixels:
252253
pp = self.pixel_pitch_meters()
253254
return fl / pp

0 commit comments

Comments
 (0)