letmaik / lensfunpy

📷 Lens distortion correction for Python, a wrapper for lensfun
https://pypi.python.org/pypi/lensfunpy
MIT License
145 stars 18 forks source link

find_lenses() on Mac seems to have trouble with certain lenses #10

Closed StefanBaar closed 7 years ago

StefanBaar commented 7 years ago

Hello, I am trying to load the lens profile for a Sigma Fisheye lens. However, I get a StopIteration error. Also it is not possible to print a list of all lenses. I have tried this on Mac Sierra and El Capitan, Python 2.7 and lensfunpy installed through PIP. This is what I input:

import lensfunpy cam_maker = 'NIKON CORPORATION' cam_model = 'NIKON D3S'

lens_maker = 'Sigma' lens_model = "Sigma 8mm f/3.5 EX DG circular fisheye"

db = lensfunpy.Database() cam = db.find_cameras(cam_maker, cam_model)[0] lens = db.find_lenses(cam, lens_maker, lens_model)[0] print(lens)

This is what I get:

StopIteration Traceback (most recent call last)

in () ----> 1 print(lens) lensfunpy/_lensfun.pyx in lensfunpy._lensfun.Lens.__repr__ (lensfunpy/_lensfun.c:7480)() lensfunpy/_lensfun.pyx in lensfunpy._lensfun.Lens.type.__get__ (lensfunpy/_lensfun.c:5771)() StopIteration: Is this a problem with lensfunpy?
letmaik commented 7 years ago

Thanks for reporting, I could reproduce it and will look at it.

letmaik commented 7 years ago

I fixed the issue and will release a new version today or tomorrow. Thanks again! EDIT: New version is out now.