Dependencies bump
This commit is contained in:
parent
a627a41375
commit
4afb94c7e1
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "libcaesium"
|
||||
version = "0.9.2"
|
||||
version = "0.9.3"
|
||||
authors = ["Matteo Paonessa <matteo.paonessa@gmail.com>"]
|
||||
edition = "2021"
|
||||
categories = ["multimedia::images"]
|
||||
|
@ -23,13 +23,13 @@ license = "Apache-2.0"
|
|||
|
||||
[dependencies]
|
||||
mozjpeg-sys = "1.0.2"
|
||||
oxipng = "5.0.1"
|
||||
oxipng = "6.0.1"
|
||||
libc = "0.2"
|
||||
gifsicle = "1.92.5"
|
||||
webp = "0.2"
|
||||
infer = "0.8"
|
||||
infer = "0.9"
|
||||
image = { version = "0.24.3", default-features = false, features = ["jpeg", "png", "webp", "gif"] }
|
||||
img-parts = "0.2"
|
||||
img-parts = "0.3"
|
||||
bytes = "1.1"
|
||||
lodepng = "3.7"
|
||||
imagequant = {git = "https://github.com/Lymphatus/libimagequant", rev = "67f1686"}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
use std::ffi::CString;
|
||||
use std::io;
|
||||
use std::os::raw::{c_int, c_void};
|
||||
|
||||
use crate::CSParameters;
|
||||
|
||||
pub struct Parameters {
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
use image::ImageOutputFormat::Jpeg;
|
||||
use img_parts::{DynImage, ImageEXIF, ImageICC};
|
||||
use mozjpeg_sys::*;
|
||||
|
||||
use std::{io, mem};
|
||||
use std::fs;
|
||||
use std::fs::File;
|
||||
use std::io::Write;
|
||||
|
||||
use image::ImageOutputFormat::Jpeg;
|
||||
use img_parts::{DynImage, ImageEXIF, ImageICC};
|
||||
use mozjpeg_sys::*;
|
||||
|
||||
use crate::CSParameters;
|
||||
use crate::resize::resize;
|
||||
|
||||
|
|
11
src/lib.rs
11
src/lib.rs
|
@ -1,3 +1,9 @@
|
|||
use std::error::Error;
|
||||
use std::ffi::{CStr, CString};
|
||||
use std::os::raw::c_char;
|
||||
|
||||
use crate::utils::get_filetype;
|
||||
|
||||
mod utils;
|
||||
mod jpeg;
|
||||
mod png;
|
||||
|
@ -5,11 +11,6 @@ mod gif;
|
|||
mod webp;
|
||||
mod resize;
|
||||
|
||||
use std::error::Error;
|
||||
use crate::utils::get_filetype;
|
||||
use std::ffi::{CStr, CString};
|
||||
use std::os::raw::c_char;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct CCSParameters {
|
||||
pub keep_metadata: bool,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
use std::env;
|
||||
use caesium::{compress, initialize_parameters};
|
||||
use std::env;
|
||||
|
||||
fn main() {
|
||||
let args: Vec<String> = env::args().collect();
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
use image::io::Reader as ImageReader;
|
||||
|
||||
use std::{fs, io};
|
||||
use std::fs::File;
|
||||
use std::io::Write;
|
||||
|
||||
use image::io::Reader as ImageReader;
|
||||
use std::num::NonZeroU8;
|
||||
use oxipng::Deflaters::Zopfli;
|
||||
|
||||
use crate::CSParameters;
|
||||
use crate::resize::resize_image;
|
||||
|
@ -88,7 +90,7 @@ fn lossless(input_path: String, parameters: CSParameters) -> Result<Vec<u8>, io:
|
|||
}
|
||||
|
||||
if parameters.optimize && parameters.png.force_zopfli {
|
||||
oxipng_options.deflate = oxipng::Deflaters::Zopfli;
|
||||
oxipng_options.deflate = Zopfli { iterations: NonZeroU8::new(15).unwrap() };
|
||||
} else {
|
||||
oxipng_options = oxipng::Options::from_preset(6);
|
||||
}
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
use std::io;
|
||||
use std::io::{Cursor};
|
||||
use image::DynamicImage;
|
||||
use image::imageops::FilterType;
|
||||
use image::io::Reader as ImageReader;
|
||||
|
||||
use std::io;
|
||||
use std::io::Cursor;
|
||||
|
||||
pub fn resize(image_buffer: Vec<u8>, width: u32, height: u32, format: image::ImageOutputFormat) -> Result<Vec<u8>, io::Error> {
|
||||
let mut image = match ImageReader::new(Cursor::new(image_buffer)).with_guessed_format()?.decode() {
|
||||
Ok(i) => i,
|
||||
|
|
|
@ -2,6 +2,7 @@ use std::fs::File;
|
|||
use std::io;
|
||||
use std::io::{Read, Write};
|
||||
use std::ops::Deref;
|
||||
|
||||
use crate::CSParameters;
|
||||
use crate::resize::resize_image;
|
||||
|
||||
|
|
Loading…
Reference in New Issue