diff --git a/codex-rs/Cargo.lock b/codex-rs/Cargo.lock index e6e9cc22cdb..3603de83b56 100644 --- a/codex-rs/Cargo.lock +++ b/codex-rs/Cargo.lock @@ -2346,6 +2346,12 @@ dependencies = [ "tracing-error", ] +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + [[package]] name = "colorchoice" version = "1.0.4" @@ -3800,6 +3806,16 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "gif" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5df2ba84018d80c213569363bdcd0c64e6933c67fe4c1d60ecf822971a3c35e" +dependencies = [ + "color_quant", + "weezl", +] + [[package]] name = "gimli" version = "0.32.3" @@ -4447,6 +4463,9 @@ checksum = "e6506c6c10786659413faa717ceebcb8f70731c0a60cbae39795fdf114519c1a" dependencies = [ "bytemuck", "byteorder-lite", + "color_quant", + "gif", + "image-webp", "moxcms", "num-traits", "png", @@ -4455,6 +4474,16 @@ dependencies = [ "zune-jpeg 0.5.12", ] +[[package]] +name = "image-webp" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525e9ff3e1a4be2fbea1fdf0e98686a6d98b4d8f937e1bf7402245af1909e8c3" +dependencies = [ + "byteorder-lite", + "quick-error", +] + [[package]] name = "impl-more" version = "0.1.9" diff --git a/codex-rs/tui/Cargo.toml b/codex-rs/tui/Cargo.toml index 8bdd4732209..3252912baf6 100644 --- a/codex-rs/tui/Cargo.toml +++ b/codex-rs/tui/Cargo.toml @@ -51,7 +51,7 @@ derive_more = { workspace = true, features = ["is_variant"] } diffy = { workspace = true } dirs = { workspace = true } dunce = { workspace = true } -image = { workspace = true, features = ["jpeg", "png"] } +image = { workspace = true, features = ["jpeg", "png", "gif", "webp"] } itertools = { workspace = true } lazy_static = { workspace = true } pathdiff = { workspace = true } diff --git a/codex-rs/tui/src/bottom_pane/chat_composer.rs b/codex-rs/tui/src/bottom_pane/chat_composer.rs index 93b3a5eeccc..c14cbc082e0 100644 --- a/codex-rs/tui/src/bottom_pane/chat_composer.rs +++ b/codex-rs/tui/src/bottom_pane/chat_composer.rs @@ -1540,7 +1540,11 @@ impl ChatComposer { fn is_image_path(path: &str) -> bool { let lower = path.to_ascii_lowercase(); - lower.ends_with(".png") || lower.ends_with(".jpg") || lower.ends_with(".jpeg") + lower.ends_with(".png") + || lower.ends_with(".jpg") + || lower.ends_with(".jpeg") + || lower.ends_with(".gif") + || lower.ends_with(".webp") } fn trim_text_elements( diff --git a/codex-rs/utils/image/Cargo.toml b/codex-rs/utils/image/Cargo.toml index b523de51025..37024973841 100644 --- a/codex-rs/utils/image/Cargo.toml +++ b/codex-rs/utils/image/Cargo.toml @@ -9,11 +9,11 @@ workspace = true [dependencies] base64 = { workspace = true } -image = { workspace = true, features = ["jpeg", "png"] } +image = { workspace = true, features = ["jpeg", "png", "gif", "webp"] } codex-utils-cache = { workspace = true } thiserror = { workspace = true } tokio = { workspace = true, features = ["fs", "rt", "rt-multi-thread", "macros"] } [dev-dependencies] -image = { workspace = true, features = ["jpeg", "png"] } +image = { workspace = true, features = ["jpeg", "png", "gif", "webp"] } tempfile = { workspace = true }