-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
no method named 'dimensions' found for type 'image::DynamicImage' #24
Comments
I have that one too. Seems to be pretty new. |
I fixed it, with the Line use image::GenericImageView; right below use:std::io::Write; |
Fixed bug hopey-dishwasher#24
Short example here for fellas use image::DynamicImage;
use image::GenericImageView;
use reqwest;
async fn load_image_from_url(url: &str) -> DynamicImage {
let resp = reqwest::get(url).await.expect("Failed to download image");
let bytes = resp.bytes().await.expect("Failed to read image bytes");
image::load_from_memory(&bytes).expect("Failed to decode image")
}
async fn example() {
let image = load_image_from_url("http://example.com/image.png").await;
let (width, height) = image.dimensions();
} |
I just tried to use Termpix and got this error:
The text was updated successfully, but these errors were encountered: