diff --git a/Cargo.toml b/Cargo.toml index c4371b5..14166d9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,7 @@ tiff = ["image/tiff"] parallel = ["oxipng?/parallel", "imagequant?/threads", "dssim/threads"] [dependencies] -mozjpeg-sys = { version = "1.1", optional = true } +mozjpeg-sys = { version = "2.2", optional = true } oxipng = { version = "9.0", default-features = false, features = ["filetime", "zopfli"], optional = true } libc = "0.2" gifsicle = { version = "1.94", optional = true } diff --git a/src/jpeg.rs b/src/jpeg.rs index 6d65219..3cad94f 100644 --- a/src/jpeg.rs +++ b/src/jpeg.rs @@ -306,9 +306,9 @@ unsafe fn set_chroma_subsampling( } } -unsafe extern "C" fn error_handler(cinfo: &mut jpeg_common_struct) { +unsafe extern "C-unwind" fn error_handler(cinfo: &mut jpeg_common_struct) { JPEG_ERROR = (*cinfo.err).msg_code; panic!("Internal JPEG error: {}", JPEG_ERROR); } -unsafe extern "C" fn error_message_handler(_cinfo: &mut jpeg_common_struct) {} +unsafe extern "C-unwind" fn error_message_handler(_cinfo: &mut jpeg_common_struct) {}