In the C implementation of MagickDeskewImage the function accepts a C float for the threshold parameter. I typed that a f64 in Rust but please let me know if you have any explicit guidance on how to convert C types.
I followed the pattern from #89 so there's no explicit unit test for this new functionality but I verified it locally with a small test project:
use magick_rust::{magick_wand_genesis, MagickWand};
use std::sync::Once;
static START: Once = Once::new();
fn process_image(path: &str) {
let mut wand = MagickWand::new();
wand.read_image(path).unwrap();
wand.deskew_image(1.0).unwrap();
wand.write_image(&format!("new-{}", path)).unwrap();
}
fn main() {
START.call_once(|| {
magick_wand_genesis();
});
let mut args = std::env::args();
// skip binary name
args.next();
// image file to strip
let path = args.next().unwrap();
println!("path: {}", path);
process_image(&path);
}
Add support for MagickDeskewImage to address #91
In the C implementation of MagickDeskewImage the function accepts a C float for the threshold parameter. I typed that a f64 in Rust but please let me know if you have any explicit guidance on how to convert C types.
I followed the pattern from #89 so there's no explicit unit test for this new functionality but I verified it locally with a small test project: