Test that `save-images` command rotates images correctly with the default backend.
(rotated_video_file, tmp_path: Path)
| 639 | # TODO(https://scenedetect.com/issues/134): This works fine with OpenCV currently, but needs to be |
| 640 | # supported for PyAV and MoviePy. |
| 641 | def test_cli_save_images_rotation(rotated_video_file, tmp_path: Path): |
| 642 | """Test that `save-images` command rotates images correctly with the default backend.""" |
| 643 | assert ( |
| 644 | invoke_scenedetect( |
| 645 | "-i {VIDEO} {DETECTOR} time {TIME} save-images", |
| 646 | VIDEO=rotated_video_file, |
| 647 | output_dir=tmp_path, |
| 648 | ) |
| 649 | == 0 |
| 650 | ) |
| 651 | images = [image for image in tmp_path.glob("*.jpg")] |
| 652 | # Should detect two scenes and generate 3 images per scene with above params. |
| 653 | assert len(images) == 6 |
| 654 | image = cv2.imread(str(images[0])) |
| 655 | assert image is not None |
| 656 | # Note same resolution as in test_cli_save_images but rotated 90 degrees. |
| 657 | assert image.shape == (1280, 544, 3) |
| 658 | |
| 659 | |
| 660 | def test_cli_save_html(tmp_path: Path): |
nothing calls this directly
no test coverage detected