Skip to content

Commit e174a1c

Browse files
wilmooreclaude
andcommitted
fix: cross-platform OpenCV compatibility for Linux builds
Use cvt_color_def instead of cvt_color with AlgorithmHint parameter which is not available in all OpenCV-rs builds. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 995ceeb commit e174a1c

File tree

4 files changed

+12
-17
lines changed

4 files changed

+12
-17
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to SceneSplit will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.1.2] - 2026-01-08
9+
10+
### Fixed
11+
12+
- Fix cross-platform OpenCV compatibility (use `cvt_color_def` instead of `cvt_color` with `AlgorithmHint`)
13+
814
## [1.1.1] - 2026-01-08
915

1016
### Fixed
@@ -52,6 +58,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5258
- OpenCV for video decoding
5359
- Fully offline operation after initial model download
5460

61+
[1.1.2]: https://github.com/wilmoore/scenesplit/compare/v1.1.1...v1.1.2
5562
[1.1.1]: https://github.com/wilmoore/scenesplit/compare/v1.1.0...v1.1.1
5663
[1.1.0]: https://github.com/wilmoore/scenesplit/compare/v1.0.0...v1.1.0
5764
[1.0.0]: https://github.com/wilmoore/scenesplit/releases/tag/v1.0.0

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "scenesplit"
3-
version = "1.1.1"
3+
version = "1.1.2"
44
edition = "2021"
55
authors = ["SceneSplit Team"]
66
description = "Offline CLI tool that extracts semantically distinct still images from video"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Extract semantically distinct still images from video.
44

55
[![CI](https://github.com/wilmoore/scenesplit/actions/workflows/ci.yml/badge.svg)](https://github.com/wilmoore/scenesplit/actions/workflows/ci.yml)
6-
[![Version](https://img.shields.io/badge/version-1.1.1-green.svg)](https://github.com/wilmoore/scenesplit/releases)
6+
[![Version](https://img.shields.io/badge/version-1.1.2-green.svg)](https://github.com/wilmoore/scenesplit/releases)
77
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/wilmoore/scenesplit/blob/main/LICENSE)
88
[![Rust](https://img.shields.io/badge/rust-2021_edition-orange.svg)](https://www.rust-lang.org/)
99

src/video.rs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use std::path::{Path, PathBuf};
44

5-
use opencv::core::{AlgorithmHint, Mat};
5+
use opencv::core::Mat;
66
use opencv::imgproc;
77
use opencv::prelude::*;
88
use opencv::videoio::{self, VideoCapture, VideoCaptureTraitConst};
@@ -175,13 +175,7 @@ impl VideoLoader {
175175

176176
// Convert BGR to RGB
177177
let mut rgb_mat = Mat::default();
178-
imgproc::cvt_color(
179-
&frame_mat,
180-
&mut rgb_mat,
181-
imgproc::COLOR_BGR2RGB,
182-
0,
183-
AlgorithmHint::ALGO_HINT_DEFAULT,
184-
)?;
178+
imgproc::cvt_color_def(&frame_mat, &mut rgb_mat, imgproc::COLOR_BGR2RGB)?;
185179

186180
// Get frame dimensions
187181
let width = rgb_mat.cols() as u32;
@@ -245,13 +239,7 @@ impl VideoLoader {
245239

246240
// Convert BGR to RGB
247241
let mut rgb_mat = Mat::default();
248-
imgproc::cvt_color(
249-
&frame_mat,
250-
&mut rgb_mat,
251-
imgproc::COLOR_BGR2RGB,
252-
0,
253-
AlgorithmHint::ALGO_HINT_DEFAULT,
254-
)?;
242+
imgproc::cvt_color_def(&frame_mat, &mut rgb_mat, imgproc::COLOR_BGR2RGB)?;
255243

256244
let width = rgb_mat.cols() as u32;
257245
let height = rgb_mat.rows() as u32;

0 commit comments

Comments
 (0)