From 82359ef29012d1028009410e4239c161320ac452 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Sat, 3 Feb 2024 23:01:42 +0800 Subject: [PATCH] fix: image rotation with orientation 4 https://github.com/image-rs/image/issues/1958#issuecomment-1925350954 --- yazi-adaptor/src/image.rs | 2 +- yazi-plugin/src/utils/log.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/yazi-adaptor/src/image.rs b/yazi-adaptor/src/image.rs index 2595b9e8..8db29c18 100644 --- a/yazi-adaptor/src/image.rs +++ b/yazi-adaptor/src/image.rs @@ -130,7 +130,7 @@ impl Image { img = match orientation { 2 => DynamicImage::ImageRgba8(imageops::flip_horizontal(&img)), 3 => DynamicImage::ImageRgba8(imageops::rotate180(&img)), - 4 => DynamicImage::ImageRgba8(imageops::flip_horizontal(&img)), + 4 => DynamicImage::ImageRgba8(imageops::flip_vertical(&img)), 5 => DynamicImage::ImageRgba8(imageops::flip_horizontal(&imageops::rotate90(&img))), 6 => DynamicImage::ImageRgba8(imageops::rotate90(&img)), 7 => DynamicImage::ImageRgba8(imageops::flip_horizontal(&imageops::rotate270(&img))), diff --git a/yazi-plugin/src/utils/log.rs b/yazi-plugin/src/utils/log.rs index 47c96cbc..e481307f 100644 --- a/yazi-plugin/src/utils/log.rs +++ b/yazi-plugin/src/utils/log.rs @@ -5,9 +5,9 @@ use super::Utils; impl Utils { pub(super) fn log(lua: &Lua, ya: &Table) -> mlua::Result<()> { - ya.set("dbg", lua.create_async_function(|_, s: String| async move { Ok(debug!("{s}")) })?)?; + ya.set("dbg", lua.create_function(|_, s: String| Ok(debug!("{s}")))?)?; - ya.set("err", lua.create_async_function(|_, s: String| async move { Ok(error!("{s}")) })?)?; + ya.set("err", lua.create_function(|_, s: String| Ok(error!("{s}")))?)?; Ok(()) }