Add reset_image_page function.

This commit is contained in:
Błażej Święcicki 2018-05-18 13:51:11 +00:00
parent b47d2e64c5
commit 631725121a

View file

@ -265,6 +265,19 @@ impl MagickWand {
(width, height, x, y)
}
/// Reset the Wand page canvas and position.
pub fn reset_image_page(&self, page_geometry: &str) -> Result<(), &'static str> {
let c_page_geometry = CString::new(page_geometry).unwrap();
let result = unsafe {
bindings::MagickResetImagePage(self.wand, c_page_geometry.as_ptr())
};
if result == bindings::MagickBooleanType::MagickTrue {
Ok(())
} else {
Err("Resetting page geometry failed.")
}
}
/// Retrieve the named image property value.
pub fn get_image_property(&self, name: &str) -> Result<String, &'static str> {
let c_name = CString::new(name).unwrap();