SenorPez / project-cars-replay-enhancer

Project CARS Replay Enhancer: Combines telemetry data with replay video to improve Project CARS replays.
MIT License
12 stars 1 forks source link

Error running with -s option and null values in config file #102

Closed Michel-NL closed 7 years ago

Michel-NL commented 7 years ago

Today i captured data from our first race. Configuration Editor went well with importing telemetry data 👍 But running the -s command gives me a error. Any idea what it is?

michel@SRV-VM-UBUNTU:~/replayenhancer$ replayenhancer -s race1-Spa_ok.json
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/PIL/Image.py", line 2285, in open
    fp.seek(0)
AttributeError: 'NoneType' object has no attribute 'seek'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/replayenhancer", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.5/dist-packages/replayenhancer/__init__.py", line 240, in main
    sync=args.sync)
  File "/usr/local/lib/python3.5/dist-packages/replayenhancer/__init__.py", line 134, in make_video
    Image.fromarray(pcre_starting_grid.to_frame()).save(
  File "/usr/local/lib/python3.5/dist-packages/replayenhancer/StaticBase.py", line 60, in to_frame
    return PIL_to_npimage(self._make_material().convert('RGBA'))
  File "/usr/local/lib/python3.5/dist-packages/replayenhancer/StaticBase.py", line 128, in _make_material
    backdrop = Image.open(self._options['backdrop'])
  File "/usr/local/lib/python3.5/dist-packages/PIL/Image.py", line 2287, in open
    fp = io.BytesIO(fp.read())
AttributeError: 'NoneType' object has no attribute 'read'
Michel-NL commented 7 years ago

The error is coming from two values i didn't fill in: "backdrop" : null, "logo" : null,

SenorPez commented 7 years ago

Yeah, this is because the UI writes all the fields, setting unset fields to "null". I didn't account for that. Should be fixed for all cases, now, since most fields are optional.

I found this over last week, but being a holiday weekend in the United States, slow to push out these changes! Sorry!

SenorPez commented 7 years ago

Fix included in Release Candidate 4, now pushed to PyPi.

Upgrade by running pip install --upgrade replayenhancer

Michel-NL commented 7 years ago

Tomorow is the next race. I will take it for a test on Thursday with the new data.

Michel-NL commented 7 years ago

Fixed