add: include ImageFormat
This commit is contained in:
parent
7607c8079d
commit
0dcc94b7cf
4 changed files with 5 additions and 3 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -171,7 +171,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "axum-image"
|
name = "axum-image"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"axum",
|
"axum",
|
||||||
"axum-extra",
|
"axum-extra",
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "axum-image"
|
name = "axum-image"
|
||||||
description = "Image extractors for Axum"
|
description = "Image extractors for Axum"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
authors = ["trisuaso"]
|
authors = ["trisuaso"]
|
||||||
repository = "https://trisua.com/t/axum-image"
|
repository = "https://trisua.com/t/axum-image"
|
||||||
|
|
|
@ -4,7 +4,7 @@ use std::{fs::File, io::BufWriter};
|
||||||
pub fn save_image_buffer(
|
pub fn save_image_buffer(
|
||||||
path: &str,
|
path: &str,
|
||||||
bytes: Vec<u8>,
|
bytes: Vec<u8>,
|
||||||
format: image::ImageFormat,
|
format: crate::ImageFormat,
|
||||||
) -> std::io::Result<()> {
|
) -> std::io::Result<()> {
|
||||||
let pre_img_buffer = match image::load_from_memory(&bytes) {
|
let pre_img_buffer = match image::load_from_memory(&bytes) {
|
||||||
Ok(i) => i,
|
Ok(i) => i,
|
||||||
|
|
|
@ -1,2 +1,4 @@
|
||||||
pub mod encode;
|
pub mod encode;
|
||||||
pub mod extract;
|
pub mod extract;
|
||||||
|
|
||||||
|
pub use image::ImageFormat;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue