fix: image rotation with orientation 4

https://github.com/image-rs/image/issues/1958#issuecomment-1925350954
This commit is contained in:
sxyazi 2024-02-03 23:01:42 +08:00
parent 5086c02380
commit 82359ef290
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

View file

@ -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))),

View file

@ -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(())
}