[Bugfix] Entering image entropy via long click raises PIL Exception #453
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes #450
The problem
Prior to this PR, the
frame is None
check did not affect later attempts to paste that frame into the Renderer upon final image click.Note: When the camera first starts up, it can initially return
frame == None
for a few cycles.If the user enters image entropy (Tools -> New seed) via a long click (click-and-hold), they enter a race condition with the camera: will the camera return a valid
frame
before the long click repeat triggers the final image logic?Resolution
This PR:
if
checks in the loopframe is None
time.sleep()
to give the camera more time to warm up.Misc
max_entropy_frames
has been reached; now cycles older frames out in order to keep writing the new preview frames. No discernible impact on performance, though I didn't attempt to measure before/after framerate.