mod image;
mod sticker_archive;
mod sticker_export;
mod sticker_video;
mod stickers;
mod video;
mod wxgf;
pub use image::ImageInspection;
pub use sticker_archive::*;
pub use sticker_export::*;
pub use sticker_video::prepare_sticker;
pub use stickers::*;
pub use video::inspect_video_container;
pub use wxgf::wxgf_preview;
pub const MAX_IMAGE_BYTES: usize = 16 * 1024 * 1024;
pub const MAX_FILE_BYTES: usize = 512 * 1024 * 1024;
pub const MAX_VIDEO_SOURCE_BYTES: usize = MAX_FILE_BYTES;
#[derive(Debug)]
pub struct DecodedImage {
pub bytes: Vec<u8>,
pub inspection: ImageInspection,
}
pub fn inspect_image(bytes: &[u8]) -> anyhow::Result<ImageInspection> {
if bytes.starts_with(b"wxgf") {
let mut inspection = wxgf_preview(bytes)?.inspection;
inspection.content_type = "image/x-wxgf".into();
inspection.animation_preserved = false;
return Ok(inspection);
}
image::inspect_standard_image(bytes)
}