From 9ceb7ac7f9ca28ba43c0c4140501aa404b13cdb0 Mon Sep 17 00:00:00 2001 From: zijiren233 Date: Mon, 3 Aug 2026 01:33:22 +0800 Subject: [PATCH] fix: remove AVIF support from builds --- .github/workflows/ci.yml | 24 +- .github/workflows/codeql.yml | 3 - .github/workflows/helm-ci.yml | 4 +- .github/workflows/helm.yml | 4 +- .github/workflows/prepare-release.yml | 3 - Cargo.lock | 391 +----------------- Cargo.toml | 2 +- Dockerfile | 3 +- synctv-core/src/service/file_storage.rs | 1 - .../service/file_storage/media_processing.rs | 27 -- .../src/service/file_upload_policies.rs | 4 +- 11 files changed, 22 insertions(+), 444 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9abeeda0..7e1ee8fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,7 +51,7 @@ jobs: components: clippy - name: Install build dependencies - run: sudo apt-get update && sudo apt-get install -y protobuf-compiler nasm libclang-dev + run: sudo apt-get update && sudo apt-get install -y nasm libclang-dev - name: Cache Rust build artifacts uses: Swatinem/rust-cache@v2 @@ -71,8 +71,8 @@ jobs: - name: Install Rust toolchain uses: dtolnay/rust-toolchain@nightly - - name: Install protobuf compiler - run: sudo apt-get update && sudo apt-get install -y protobuf-compiler + - name: Install build dependencies + run: sudo apt-get update && sudo apt-get install -y nasm libclang-dev - name: Cache Rust build artifacts uses: Swatinem/rust-cache@v2 @@ -90,8 +90,8 @@ jobs: - name: Install Rust toolchain uses: dtolnay/rust-toolchain@nightly - - name: Install protobuf compiler - run: sudo apt-get update && sudo apt-get install -y protobuf-compiler + - name: Install build dependencies + run: sudo apt-get update && sudo apt-get install -y nasm libclang-dev - name: Cache Rust build artifacts uses: Swatinem/rust-cache@v2 @@ -111,7 +111,7 @@ jobs: uses: dtolnay/rust-toolchain@nightly - name: Install build dependencies - run: sudo apt-get update && sudo apt-get install -y protobuf-compiler nasm libclang-dev + run: sudo apt-get update && sudo apt-get install -y nasm libclang-dev - name: Cache Rust build artifacts uses: Swatinem/rust-cache@v2 @@ -141,15 +141,11 @@ jobs: - name: Install build dependencies on Linux if: runner.os == 'Linux' - run: sudo apt-get update && sudo apt-get install -y protobuf-compiler nasm libclang-dev + run: sudo apt-get update && sudo apt-get install -y nasm libclang-dev - name: Install build dependencies on macOS if: runner.os == 'macOS' - run: brew install protobuf nasm - - - name: Install protobuf compiler on Windows - if: runner.os == 'Windows' - run: choco install protoc --yes + run: brew install nasm - name: Install Make on Windows if: runner.os == 'Windows' @@ -188,7 +184,7 @@ jobs: - name: Install build dependencies on Linux if: runner.os == 'Linux' - run: sudo apt-get update && sudo apt-get install -y protobuf-compiler nasm libclang-dev + run: sudo apt-get update && sudo apt-get install -y nasm libclang-dev - name: Cache Rust build artifacts uses: Swatinem/rust-cache@v2 @@ -261,7 +257,7 @@ jobs: uses: dtolnay/rust-toolchain@nightly - name: Install build dependencies - run: sudo apt-get update && sudo apt-get install -y protobuf-compiler nasm libclang-dev + run: sudo apt-get update && sudo apt-get install -y nasm libclang-dev - name: Install cargo-udeps run: make install-cargo-udeps diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 374cca42..7449521d 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -36,9 +36,6 @@ jobs: - name: Install Rust toolchain uses: dtolnay/rust-toolchain@nightly - - name: Install protobuf compiler - run: sudo apt-get update && sudo apt-get install -y protobuf-compiler - - name: Initialize CodeQL uses: github/codeql-action/init@v4 with: diff --git a/.github/workflows/helm-ci.yml b/.github/workflows/helm-ci.yml index bea614c6..6261f7c3 100644 --- a/.github/workflows/helm-ci.yml +++ b/.github/workflows/helm-ci.yml @@ -51,8 +51,8 @@ jobs: - name: Install Rust toolchain uses: dtolnay/rust-toolchain@nightly - - name: Install protobuf compiler - run: sudo apt-get update && sudo apt-get install -y protobuf-compiler + - name: Install build dependencies + run: sudo apt-get update && sudo apt-get install -y nasm libclang-dev - name: Validate chart run: make validate-helm diff --git a/.github/workflows/helm.yml b/.github/workflows/helm.yml index dfe0de06..6193b46a 100644 --- a/.github/workflows/helm.yml +++ b/.github/workflows/helm.yml @@ -53,8 +53,8 @@ jobs: - name: Install Rust toolchain uses: dtolnay/rust-toolchain@nightly - - name: Install protobuf compiler - run: sudo apt-get update && sudo apt-get install -y protobuf-compiler + - name: Install build dependencies + run: sudo apt-get update && sudo apt-get install -y nasm libclang-dev - name: Validate source chart run: make validate-helm diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index 94a09952..a09e9487 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -30,9 +30,6 @@ jobs: - name: Install Rust toolchain uses: dtolnay/rust-toolchain@nightly - - name: Install protobuf compiler - run: sudo apt-get update && sudo apt-get install -y protobuf-compiler - - name: Normalize release version id: version shell: bash diff --git a/Cargo.lock b/Cargo.lock index 076332b6..76c73ec4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -109,15 +109,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "aligned" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee4508988c62edf04abd8d92897fca0c2995d907ce1dfeaf369dac3716a40685" -dependencies = [ - "as-slice", -] - [[package]] name = "aligned-vec" version = "0.6.4" @@ -292,17 +283,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03918c3dbd7701a85c6b9887732e2921175f26c350b4563841d0958c21d57e6d" -[[package]] -name = "arg_enum_proc_macro" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.118", -] - [[package]] name = "argon2" version = "0.5.3" @@ -327,15 +307,6 @@ version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3fb67a6e08acf24fdeccbac2cb6ac4305825bd1f117462e0e6f2f193345ad56" -[[package]] -name = "as-slice" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "516b6b4f0e40d50dcda9365d53964ec74560ad4284da2e7fc97122cd83174516" -dependencies = [ - "stable_deref_trait", -] - [[package]] name = "asn1-rs" version = "0.6.2" @@ -489,62 +460,6 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" -[[package]] -name = "av-data" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fca67ba5d317924c02180c576157afd54babe48a76ebc66ce6d34bb8ba08308e" -dependencies = [ - "byte-slice-cast", - "bytes", - "num-derive", - "num-rational", - "num-traits", -] - -[[package]] -name = "av-scenechange" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f321d77c20e19b92c39e7471cf986812cbb46659d2af674adc4331ef3f18394" -dependencies = [ - "aligned", - "anyhow", - "arg_enum_proc_macro", - "arrayvec", - "log", - "num-rational", - "num-traits", - "pastey 0.1.1", - "rayon", - "thiserror 2.0.19", - "v_frame", - "y4m", -] - -[[package]] -name = "av1-grain" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cfddb07216410377231960af4fcab838eaa12e013417781b78bd95ee22077f8" -dependencies = [ - "anyhow", - "arrayvec", - "log", - "nom 8.0.0", - "num-rational", - "v_frame", -] - -[[package]] -name = "avif-serialize" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7178fe5f7d460b13895ebb9dcb28a3a6216d2df2574a0806cb51b555d297f38" -dependencies = [ - "arrayvec", -] - [[package]] name = "aws-lc-rs" version = "1.17.1" @@ -739,30 +654,12 @@ dependencies = [ "serde_core", ] -[[package]] -name = "bitreader" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "886559b1e163d56c765bc3a985febb4eee8009f625244511d8ee3c432e08c066" -dependencies = [ - "cfg-if", -] - [[package]] name = "bitstream-io" version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6099cdc01846bc367c4e7dd630dc5966dccf36b652fae7a74e17b640411a91b2" -[[package]] -name = "bitstream-io" -version = "4.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eff00be299a18769011411c9def0d827e8f2d7bf0c3dbf53633147a8867fd1f" -dependencies = [ - "no_std_io2", -] - [[package]] name = "blake2" version = "0.10.6" @@ -1066,24 +963,12 @@ dependencies = [ "memchr", ] -[[package]] -name = "built" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c0e531d93d39c34eef561e929e8a7f86d77a5af08aac4f6d6e39976c51858e9" - [[package]] name = "bumpalo" version = "3.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" -[[package]] -name = "byte-slice-cast" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7575182f7272186991736b70173b0ea045398f984bf5ebbb3804736ce1330c9d" - [[package]] name = "bytemuck" version = "1.25.1" @@ -1181,7 +1066,7 @@ dependencies = [ "chrono", "lazy_static", "nom 7.1.3", - "pastey 0.2.3", + "pastey", "regex", "serde", "serde_json", @@ -1197,16 +1082,6 @@ dependencies = [ "nom 7.1.3", ] -[[package]] -name = "cfg-expr" -version = "0.20.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb693542bcafa528e198be0ebd9d3632ca5b7c93dbe7237460e199910835997c" -dependencies = [ - "smallvec", - "target-lexicon", -] - [[package]] name = "cfg-if" version = "1.0.4" @@ -1953,28 +1828,6 @@ version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4ae5f15dda3c708c0ade84bfee31ccab44a3da4f88015ed22f63732abe300c8" -[[package]] -name = "dav1d" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ee89cb860616069c67520dcd66cacdb900b57c799f634a0eb6d91f6e2a82b61" -dependencies = [ - "av-data", - "bitflags 2.13.0", - "dav1d-sys", - "static_assertions", -] - -[[package]] -name = "dav1d-sys" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c91aea6668645415331133ed6f8ddf0e7f40160cd97a12d59e68716a58704b" -dependencies = [ - "libc", - "system-deps", -] - [[package]] name = "deadpool" version = "0.12.3" @@ -2470,15 +2323,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" -[[package]] -name = "fallible_collections" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a88c69768c0a15262df21899142bc6df9b9b823546d4b4b9a7bc2d6c448ec6fd" -dependencies = [ - "hashbrown 0.13.2", -] - [[package]] name = "fancy-regex" version = "0.18.0" @@ -2962,7 +2806,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "036a78b2620d92f0ec57690bc792b3bb87348632ee5225302ba2e66a48021c6c" dependencies = [ - "bitstream-io 2.6.0", + "bitstream-io", "hex-slice", "log", "memchr", @@ -3002,15 +2846,6 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - [[package]] name = "hashbrown" version = "0.14.5" @@ -3584,15 +3419,11 @@ dependencies = [ "bytemuck", "byteorder-lite", "color_quant", - "dav1d", "gif", "image-webp", "moxcms", - "mp4parse", "num-traits", "png", - "ravif", - "rgb", "zune-core", "zune-jpeg", ] @@ -3607,12 +3438,6 @@ dependencies = [ "quick-error", ] -[[package]] -name = "imgref" -version = "1.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89194689a993ab15268672e99e7b0e19da2da3268ac682e8f02d29d4d1434cd7" - [[package]] name = "indexmap" version = "1.9.3" @@ -3656,17 +3481,6 @@ dependencies = [ "hybrid-array", ] -[[package]] -name = "interpolate_name" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.118", -] - [[package]] name = "intrusive-collections" version = "0.9.7" @@ -4009,16 +3823,6 @@ version = "0.2.186" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" -[[package]] -name = "libfuzzer-sys" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9fd2f41a1cba099f79a0b6b6c35656cf7c03351a7bae8ff0f28f25270f929d2" -dependencies = [ - "arbitrary", - "cc", -] - [[package]] name = "libloading" version = "0.8.9" @@ -4093,15 +3897,6 @@ version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" -[[package]] -name = "loop9" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fae87c125b03c1d2c0150c90365d7d6bcc53fb73a9acaef207d2d065860f062" -dependencies = [ - "imgref", -] - [[package]] name = "lru" version = "0.18.1" @@ -4152,15 +3947,6 @@ version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8863b587001c1b9a8a4e36008cebc6b3612cb1226fe2de94858e06092687b608" -[[package]] -name = "maybe-rayon" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea1f30cedd69f0a2954655f7188c6a834246d2bcf1e315e2ac40c4b24dc9519" -dependencies = [ - "cfg-if", -] - [[package]] name = "md-5" version = "0.10.6" @@ -4313,20 +4099,6 @@ dependencies = [ "pxfm", ] -[[package]] -name = "mp4parse" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63a35203d3c6ce92d5251c77520acb2e57108c88728695aa883f70023624c570" -dependencies = [ - "bitreader", - "byteorder", - "fallible_collections", - "log", - "num-traits", - "static_assertions", -] - [[package]] name = "mp4ra-rust" version = "0.3.0" @@ -4378,15 +4150,6 @@ version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" -[[package]] -name = "no_std_io2" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418abd1b6d34fbf6cae440dc874771b0525a604428704c76e48b29a5e67b8003" -dependencies = [ - "memchr", -] - [[package]] name = "nohash-hasher" version = "0.2.0" @@ -4424,12 +4187,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38bf9645c8b145698bb0b18a4637dcacbc421ea49bef2317e4fd8065a387cf21" -[[package]] -name = "noop_proc_macro" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8" - [[package]] name = "nu-ansi-term" version = "0.50.3" @@ -4505,17 +4262,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441" -[[package]] -name = "num-derive" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.118", -] - [[package]] name = "num-integer" version = "0.1.46" @@ -5154,12 +4900,6 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" -[[package]] -name = "pastey" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35fb2e5f958ec131621fdd531e9fc186ed768cbe395337403ae56c17a74c68ec" - [[package]] name = "pastey" version = "0.2.3" @@ -5701,25 +5441,6 @@ dependencies = [ "hex", ] -[[package]] -name = "profiling" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d595e54a326bc53c1c197b32d295e14b169e3cfeaa8dc82b529f947fba6bcf5" -dependencies = [ - "profiling-procmacros", -] - -[[package]] -name = "profiling-procmacros" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4488a4a36b9a4ba6b9334a32a39971f77c1436ec82c38707bce707699cc3bbcb" -dependencies = [ - "quote", - "syn 2.0.118", -] - [[package]] name = "prometheus" version = "0.14.0" @@ -6183,55 +5904,6 @@ dependencies = [ "rand_core 0.10.1", ] -[[package]] -name = "rav1e" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43b6dd56e85d9483277cde964fd1bdb0428de4fec5ebba7540995639a21cb32b" -dependencies = [ - "aligned-vec", - "arbitrary", - "arg_enum_proc_macro", - "arrayvec", - "av-scenechange", - "av1-grain", - "bitstream-io 4.10.0", - "built", - "cfg-if", - "interpolate_name", - "itertools 0.14.0", - "libc", - "libfuzzer-sys", - "log", - "maybe-rayon", - "new_debug_unreachable", - "noop_proc_macro", - "num-derive", - "num-traits", - "paste", - "profiling", - "rand 0.9.5", - "rand_chacha 0.9.0", - "simd_helpers", - "thiserror 2.0.19", - "v_frame", - "wasm-bindgen", -] - -[[package]] -name = "ravif" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e52310197d971b0f5be7fe6b57530dcd27beb35c1b013f29d66c1ad73fbbcc45" -dependencies = [ - "avif-serialize", - "imgref", - "loop9", - "quick-error", - "rav1e", - "rgb", -] - [[package]] name = "raw-cpuid" version = "11.6.0" @@ -6497,7 +6169,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e15d30599ab355dde5e0d443463e1c6177278e3a9822e2393c0d3ed98789edd0" dependencies = [ "base64 0.22.1", - "bitstream-io 2.6.0", + "bitstream-io", "bytes", "derive_more", "futures", @@ -6537,12 +6209,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "rgb" -version = "0.8.53" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47b34b781b31e5d73e9fbc8689c70551fd1ade9a19e3e28cfec8580a79290cc4" - [[package]] name = "ring" version = "0.17.14" @@ -7312,15 +6978,6 @@ dependencies = [ "simdutf8", ] -[[package]] -name = "simd_helpers" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95890f873bec569a0362c235787f3aca6e1e887302ba4840839bcc6459c42da6" -dependencies = [ - "quote", -] - [[package]] name = "simdutf8" version = "0.1.5" @@ -8813,19 +8470,6 @@ dependencies = [ "libc", ] -[[package]] -name = "system-deps" -version = "7.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "396a35feb67335377e0251fcbc1092fc85c484bd4e3a7a54319399da127796e7" -dependencies = [ - "cfg-expr", - "heck", - "pkg-config", - "toml", - "version-compare", -] - [[package]] name = "tag_ptr" version = "0.1.0" @@ -8844,12 +8488,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" -[[package]] -name = "target-lexicon" -version = "0.13.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca" - [[package]] name = "tempfile" version = "3.27.0" @@ -9864,17 +9502,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "v_frame" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "666b7727c8875d6ab5db9533418d7c764233ac9c0cff1d469aec8fa127597be2" -dependencies = [ - "aligned-vec", - "num-traits", - "wasm-bindgen", -] - [[package]] name = "valuable" version = "0.1.1" @@ -9887,12 +9514,6 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" -[[package]] -name = "version-compare" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03c2856837ef78f57382f06b2b8563a2f512f7185d732608fd9176cb3b8edf0e" - [[package]] name = "version_check" version = "0.9.5" @@ -10467,12 +10088,6 @@ version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d93c89cdc2d3a63c3ec48ffe926931bdc069eafa8e4402fe6d8f790c9d1e576" -[[package]] -name = "y4m" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5a4b21e1a62b67a2970e6831bc091d7b87e119e7f9791aef9702e3bef04448" - [[package]] name = "yaml-rust2" version = "0.11.0" diff --git a/Cargo.toml b/Cargo.toml index 03970fa6..00583c02 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -317,7 +317,7 @@ lz4_flex = { version = "=0.14.0", default-features = false, features = [ "safe-decode", ] } zstd = { version = "=0.13.3", default-features = false } -image = { version = "=0.25.10", default-features = false, features = ["jpeg", "png", "webp", "avif", "avif-native", "gif"] } +image = { version = "=0.25.10", default-features = false, features = ["jpeg", "png", "webp", "gif"] } symphonia = { version = "=0.6.0", default-features = false, features = ["opt-simd", "all-formats", "aac", "flac", "mp3", "vorbis"] } # Resilience diff --git a/Dockerfile b/Dockerfile index 8b62fab5..fb76db4b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,9 +5,10 @@ FROM rust:slim-trixie AS builder # build-essential, perl, cmake needed for vendored builds (xiu/opus dependencies) # curl needed for utoipa-swagger-ui to download assets RUN apt-get update && apt-get install -y \ - protobuf-compiler \ pkg-config \ build-essential \ + libclang-dev \ + nasm \ cmake \ curl \ perl \ diff --git a/synctv-core/src/service/file_storage.rs b/synctv-core/src/service/file_storage.rs index 39655cd4..e5df1227 100644 --- a/synctv-core/src/service/file_storage.rs +++ b/synctv-core/src/service/file_storage.rs @@ -1538,7 +1538,6 @@ pub(super) fn file_object_key( "image/jpeg" | "image/jpg" => "jpg", "image/png" => "png", "image/gif" => "gif", - "image/avif" => "avif", "image/webp" => "webp", _ => "bin", }; diff --git a/synctv-core/src/service/file_storage/media_processing.rs b/synctv-core/src/service/file_storage/media_processing.rs index 8bb23563..29aabd4e 100644 --- a/synctv-core/src/service/file_storage/media_processing.rs +++ b/synctv-core/src/service/file_storage/media_processing.rs @@ -431,30 +431,3 @@ fn variant_object_key(original_object_key: &str, variant_key: &str) -> String { None => format!("{original}.{variant_key}.jpg"), } } - -#[cfg(test)] -mod tests { - use std::io::Cursor; - - use image::{ - codecs::avif::AvifEncoder, ColorType, GenericImageView, ImageEncoder, ImageReader, - }; - - #[test] - fn avif_uploads_are_decodable_for_variant_processing() { - let pixels = [ - 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, - ]; - let mut encoded = Vec::new(); - AvifEncoder::new(&mut encoded) - .write_image(&pixels, 2, 2, ColorType::Rgb8.into()) - .expect("AVIF encoder should accept the fixture"); - - let image = ImageReader::new(Cursor::new(encoded)) - .with_guessed_format() - .expect("AVIF format should be detected") - .decode() - .expect("AVIF uploads should be decodable"); - assert_eq!(image.dimensions(), (2, 2)); - } -} diff --git a/synctv-core/src/service/file_upload_policies.rs b/synctv-core/src/service/file_upload_policies.rs index b6d42778..cbdd3496 100644 --- a/synctv-core/src/service/file_upload_policies.rs +++ b/synctv-core/src/service/file_upload_policies.rs @@ -15,7 +15,7 @@ pub const MAX_USER_AVATAR_HEIGHT: i32 = 2048; pub const MAX_COVER_IMAGE_WIDTH: i32 = 4096; pub const MAX_COVER_IMAGE_HEIGHT: i32 = 4096; -const COVER_IMAGE_MIME_TYPES: &[&str] = &["image/jpeg", "image/png", "image/webp", "image/avif"]; +const COVER_IMAGE_MIME_TYPES: &[&str] = &["image/jpeg", "image/png", "image/webp"]; const CHAT_ATTACHMENT_MIME_TYPES: &[&str] = &[ "application/json", "application/pdf", @@ -261,7 +261,7 @@ mod tests { ), ( media_cover_upload_policy(), - "image/avif", + "image/png", MAX_MEDIA_COVER_SIZE_BYTES, ), (