jim-easterbrook / Photini

An easy to use digital photograph metadata (Exif, IPTC, XMP) editing application.
https://photini.readthedocs.io/
GNU General Public License v3.0
162 stars 24 forks source link

Initialise template error: photini.pyqt: 'NoneType' object has no attribute 'year' #239

Closed Draeken closed 1 month ago

Draeken commented 3 months ago

Fresh install on Windows10, Python 3.12, using PySide 6 (also try with PyQt6):

complete log:

12:23:38: ERROR: photini.pyqt: 'NoneType' object has no attribute 'year'
Traceback (most recent call last):
  File "C:\Users\***\photini\Lib\site-packages\photini\pyqt.py", line 190, in wrapper
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\***\photini\Lib\site-packages\photini\ownership.py", line 356, in init_template
    year = str(date_taken.year)
               ^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'year'
jim-easterbrook commented 3 months ago

Thank you for finding that - I'd never tried initialising a template from a photo without date_taken metadata. I'll fix it in the next release.

As a workaround, can you try setting the date_taken on a photo and then using it to initialise the template.

Draeken commented 3 months ago

I was testing the feature on a screenshot, not the ideal test subject haha.

The workaround works well, thank you.