diff --git a/Cargo.toml b/Cargo.toml index 7dd1af4..9126d9d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,14 +16,14 @@ opener = "^0.7" anyhow = "^1.0" #arrow = {version = "0.13.0", optional = true} # nightly -image = {version = "^0.23", optional = true} -nalgebra = {version = "^0.26", optional = true} -num-traits = {version = "^0.2", optional = true} -ndarray = {version = "^0.15", optional = true} +image = { version = "^0.25", optional = true } +nalgebra = { version = "^0.33", optional = true } +num-traits = { version = "^0.2", optional = true } +ndarray = { version = "^0.16", optional = true } [dev-dependencies] -mime = "0.3.14" -nalgebra = "0.26.1" +mime = "0.3" +nalgebra = "0.33" [features] default = [] @@ -31,3 +31,7 @@ all = ["show_nalgebra", "show_ndarray", "show_image"] show_nalgebra = ["nalgebra", "num-traits"] show_ndarray = ["ndarray"] show_image = ["image"] + +[[example]] +name = "sample_nalgebra" +required-features = ["nalgebra"] diff --git a/src/show_image.rs b/src/show_image.rs index 6209ca6..9ba628e 100644 --- a/src/show_image.rs +++ b/src/show_image.rs @@ -14,6 +14,9 @@ use crate::Showable; use anyhow::{anyhow, Error}; use base64::prelude::*; use image; +use image::EncodableLayout; +use image::PixelWithColorType; +use std::io::Cursor; use std::ops::Deref; impl Showable for image::DynamicImage { @@ -34,17 +37,14 @@ impl Showable for image::DynamicImage { impl
Showable for image::ImageBuffer
where
- P: image::Pixel ::COLOR_TYPE,
- )?;
+ let mut buffer: Vec{} ", c));
}
html.push_str("");
- for (r, row) in v.genrows().into_iter().enumerate() {
+ for (r, row) in v.rows().into_iter().enumerate() {
html.push_str("");
html.push_str(&format!(" {} ", r));
for v in row.iter() {