add get_image_page to MagickWand

get_image_page (MagickGetImagePage) is especially useful
for determining the overall dimensions of a GIF, which may have
frames with different widths and heights. In such cases,
get_image_width and get_image_height report the dimensions of
the last frame only.
This commit is contained in:
little-bobby-tables
2017-08-23 19:35:11 +07:00
parent a1d50c2f01
commit f6c55ba836
3 changed files with 21 additions and 0 deletions

View File

@ -208,3 +208,15 @@ fn test_set_option() {
assert_eq!(192, wand.get_image_width());
assert_eq!(144, wand.get_image_height());
}
#[test]
fn test_page_geometry() {
START.call_once(|| {
magick_wand_genesis();
});
let wand = MagickWand::new();
assert!(wand.read_image("tests/data/rust.gif").is_ok());
assert_eq!((156, 150, 39, 36), wand.get_image_page()); /* width, height, x offset, y offset */
assert_eq!(80, wand.get_image_width());
assert_eq!(76, wand.get_image_height());
}