You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
main.rs
use image::{imageops::FilterType, GenericImageView};
fn main() {
let img: image::DynamicImage = image::open("C:/Users/t/Pictures/B438097临时/21.jpg").unwrap();
let img = img.resize(500, 500, FilterType::Lanczos3);
//我想知道如何在保存前通过内存的方法获取图片的实际大小,谢谢
//I want to know how to get the actual size of the picture by the method of memory before saving, thanks
println!("{:?}", &img.as_bytes().len());
img.save("test.jpg").unwrap();
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
cargo.toml
[dependencies]
image = "0.25.2"
main.rs
use image::{imageops::FilterType, GenericImageView};
fn main() {
}
Beta Was this translation helpful? Give feedback.
All reactions