Fix missing feature flags in graphics::image

This commit is contained in:
Héctor Ramón Jiménez 2025-10-28 21:31:15 +01:00
parent 867fe819c0
commit 74c8641e2c
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
2 changed files with 5 additions and 4 deletions

View file

@ -6,8 +6,6 @@ use crate::core::Rectangle;
use crate::core::image;
use crate::core::svg;
use std::sync::Arc;
/// A raster or vector image.
#[allow(missing_docs)]
#[derive(Debug, Clone, PartialEq)]
@ -40,6 +38,7 @@ impl Image {
}
/// An image buffer.
#[cfg(feature = "image")]
pub type Buffer = ::image::ImageBuffer<::image::Rgba<u8>, image::Bytes>;
#[cfg(feature = "image")]
@ -149,7 +148,10 @@ pub fn load(handle: &image::Handle) -> Result<Buffer, image::Error> {
}
}
#[cfg(feature = "image")]
fn to_error(error: ::image::ImageError) -> image::Error {
use std::sync::Arc;
match error {
::image::ImageError::IoError(error) => {
image::Error::Inaccessible(Arc::new(error))

View file

@ -1,13 +1,12 @@
use crate::core::Size;
use crate::core::image;
use crate::graphics;
use crate::graphics::image::image_rs;
use crate::image::atlas::{self, Atlas};
use rustc_hash::{FxHashMap, FxHashSet};
use std::sync::{Arc, Weak};
pub type Image = image_rs::ImageBuffer<image_rs::Rgba<u8>, image::Bytes>;
pub type Image = graphics::image::Buffer;
/// Entry in cache corresponding to an image handle
#[derive(Debug)]