Skip to content

Commit b79c196

Browse files
committed
fix: gate ocr_image call in screenshot.rs for Windows compatibility
Windows ocr_image takes 2 args (no uses_language_correction param). Add #[cfg] to fix the Windows build.
1 parent 48039e1 commit b79c196

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/tools/screenshot.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,13 @@ pub async fn take_screenshot(
182182

183183
// Run OCR if requested
184184
if params.include_ocr {
185-
match platform::ocr_image(
186-
&screenshot.png_data,
187-
Some(screenshot.scale_factor),
188-
false,
189-
) {
185+
#[cfg(target_os = "macos")]
186+
let ocr_result =
187+
platform::ocr_image(&screenshot.png_data, Some(screenshot.scale_factor), false);
188+
#[cfg(target_os = "windows")]
189+
let ocr_result =
190+
platform::ocr_image(&screenshot.png_data, Some(screenshot.scale_factor));
191+
match ocr_result {
190192
Ok(mut matches) => {
191193
apply_ocr_offset(&mut matches, screenshot.origin_x, screenshot.origin_y);
192194
if !matches.is_empty() {

0 commit comments

Comments
 (0)