Commit 962c9897 authored by Niklas Mischkulnig's avatar Niklas Mischkulnig

Turbopack: enable AVIF

parent 40a4c11b
...@@ -27,9 +27,7 @@ plugin = [ ...@@ -27,9 +27,7 @@ plugin = [
image-webp = ["next-core/image-webp"] image-webp = ["next-core/image-webp"]
image-avif = ["next-core/image-avif"] image-avif = ["next-core/image-avif"]
# Enable all the available image codec support. # Enable all the available image codec support.
# Currently this is identical to `image-webp`, as we are not able to build image-extended = ["image-webp", "image-avif"]
# other codecs easily yet.
image-extended = ["image-webp"]
# Enable dhat profiling allocator for heap profiling. # Enable dhat profiling allocator for heap profiling.
__internal_dhat-heap = ["dhat"] __internal_dhat-heap = ["dhat"]
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
"build-native": "napi build --platform -p next-swc-napi --cargo-cwd ../../ --cargo-name next_swc_napi --features plugin,image-extended --js false native", "build-native": "napi build --platform -p next-swc-napi --cargo-cwd ../../ --cargo-name next_swc_napi --features plugin,image-extended --js false native",
"build-native-release": "napi build --platform -p next-swc-napi --cargo-cwd ../../ --cargo-name next_swc_napi --release --features plugin,image-extended,tracing/release_max_level_trace --js false native", "build-native-release": "napi build --platform -p next-swc-napi --cargo-cwd ../../ --cargo-name next_swc_napi --release --features plugin,image-extended,tracing/release_max_level_trace --js false native",
"build-native-release-with-assertions": "napi build --platform -p next-swc-napi --cargo-cwd ../../ --cargo-name next_swc_napi --profile release-with-assertions --features plugin,image-extended,tracing/release_max_level_trace --js false native", "build-native-release-with-assertions": "napi build --platform -p next-swc-napi --cargo-cwd ../../ --cargo-name next_swc_napi --profile release-with-assertions --features plugin,image-extended,tracing/release_max_level_trace --js false native",
"build-native-no-plugin": "napi build --platform -p next-swc-napi --cargo-cwd ../../ --cargo-name next_swc_napi --features image-webp --js false native", "build-native-no-plugin": "napi build --platform -p next-swc-napi --cargo-cwd ../../ --cargo-name next_swc_napi --features image-extended --js false native",
"build-native-no-plugin-release": "napi build --platform -p next-swc-napi --cargo-cwd ../../ --cargo-name next_swc_napi --release --features image-webp,tracing/release_max_level_trace --js false native", "build-native-no-plugin-release": "napi build --platform -p next-swc-napi --cargo-cwd ../../ --cargo-name next_swc_napi --release --features image-extended,tracing/release_max_level_trace --js false native",
"build-native-wasi": "npx --package=@napi-rs/cli@3.0.0-alpha.45 napi build --platform --target wasm32-wasip1-threads -p next-swc-napi --cwd ../../ --output-dir packages/next-swc/native --no-default-features", "build-native-wasi": "npx --package=@napi-rs/cli@3.0.0-alpha.45 napi build --platform --target wasm32-wasip1-threads -p next-swc-napi --cwd ../../ --output-dir packages/next-swc/native --no-default-features",
"build-wasm": "wasm-pack build ../../crates/wasm --scope=next", "build-wasm": "wasm-pack build ../../crates/wasm --scope=next",
"cache-build-native": "[ -d native ] && echo $(ls native)", "cache-build-native": "[ -d native ] && echo $(ls native)",
......
...@@ -132,12 +132,13 @@ fn load_image( ...@@ -132,12 +132,13 @@ fn load_image(
/// Type of raw image buffer read by reader from `load_image`. /// Type of raw image buffer read by reader from `load_image`.
/// If the image could not be decoded, the raw bytes are returned. /// If the image could not be decoded, the raw bytes are returned.
enum ImageBuffer { enum ImageBuffer {
#[allow(unused)]
Raw(Vec<u8>), Raw(Vec<u8>),
Decoded(image::DynamicImage), Decoded(image::DynamicImage),
} }
fn load_image_internal( fn load_image_internal(
image: ResolvedVc<Box<dyn Source>>, #[allow(unused_variables)] image: ResolvedVc<Box<dyn Source>>,
bytes: &[u8], bytes: &[u8],
extension: &str, extension: &str,
) -> Result<(ImageBuffer, Option<ImageFormat>)> { ) -> Result<(ImageBuffer, Option<ImageFormat>)> {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment