thomasgruebl / rusty-tesseract

A Rust wrapper for Google Tesseract
MIT License
124 stars 14 forks source link

Updated the version of the image library from 0.23.14 to 0.24 #9

Closed Gakgu closed 1 year ago

Gakgu commented 1 year ago

Updated the version of the image library from 0.23.14 to 0.24 to resolve type mismatch

Previously, using the latest version of the image library (0.24) resulted in a type mismatch error when interfacing with rusty_tesseract, which uses version 0.23.14 of the image library. This update resolves that issue by aligning the version of the image library used in the main code with the version used by rusty_tesseract.

fn main() {
    // image version is 0.24
    let dynamic_image = image::io::Reader::open("img/string.png")
        .unwrap()
        .decode()
        .unwrap();

    // rusty_tesseract image version is 0.23.14
    let img = rusty_tesseract::tesseract::input::Image::from_dynamic_image(&dynamic_image).unwrap(); // Error
}
error[E0308]: mismatched types --> src\main.rs:9:76 7 let img = rusty_tesseract::tesseract::input::Image::from_dynamic_image(&dynamic_image).unwrap(); ------------------------------------------------------------ ^^^^^^^^^^^^^^ expected rusty_tesseract::image::DynamicImage, found image::DynamicImage
arguments to this function are incorrect

This update ensures that our usage of the image library is compatible with rusty_tesseract, eliminating the type mismatch error.