set shortest edge to preview height (#11971)

This commit is contained in:
Blake Blackshear 2024-06-15 06:42:23 -05:00 committed by GitHub
parent 0d862d6aa8
commit 15e2df1e5c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -152,9 +152,19 @@ class PreviewRecorder:
self.start_time = 0 self.start_time = 0
self.last_output_time = 0 self.last_output_time = 0
self.output_frames = [] self.output_frames = []
if config.detect.width > config.detect.height:
self.out_height = PREVIEW_HEIGHT self.out_height = PREVIEW_HEIGHT
self.out_width = ( self.out_width = (
int((config.detect.width / config.detect.height) * self.out_height) // 4 * 4 int((config.detect.width / config.detect.height) * self.out_height)
// 4
* 4
)
else:
self.out_width = PREVIEW_HEIGHT
self.out_height = (
int((config.detect.height / config.detect.width) * self.out_width)
// 4
* 4
) )
# create communication for finished previews # create communication for finished previews