Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
c5f3bef1
Commit
c5f3bef1
authored
Jan 05, 2026
by
Niklas Mischkulnig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly enable avif
parent
962c9897
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
277 additions
and
96 deletions
+277
-96
Cargo.lock
Cargo.lock
+273
-71
Cargo.toml
Cargo.toml
+1
-1
Cargo.toml
turbopack/crates/turbopack-image/Cargo.toml
+2
-2
mod.rs
turbopack/crates/turbopack-image/src/process/mod.rs
+1
-22
No files found.
Cargo.lock
View file @
c5f3bef1
This diff is collapsed.
Click to expand it.
Cargo.toml
View file @
c5f3bef1
...
...
@@ -397,7 +397,7 @@ futures = "0.3.31"
futures-retry
=
"0.6.0"
futures-util
=
"0.3.31"
hashbrown
=
"0.14.5"
image
=
{
version
=
"0.25.
8
"
,
default-features
=
false
}
image
=
{
version
=
"0.25.
9
"
,
default-features
=
false
}
indexmap
=
"2.7.1"
indoc
=
"2.0.0"
inventory
=
"0.3.21"
...
...
turbopack/crates/turbopack-image/Cargo.toml
View file @
c5f3bef1
...
...
@@ -11,8 +11,8 @@ bench = false
[features]
# [NOTE]: Before enabl
e
this, ensure this can build all of the target platforms we support.
avif
=
["image/avif"]
# [NOTE]: Before enabl
ing
this, ensure this can build all of the target platforms we support.
avif
=
[
"image/avif"
,
"image/avif-native"
]
webp
=
["image/webp"]
[lints]
...
...
turbopack/crates/turbopack-image/src/process/mod.rs
View file @
c5f3bef1
...
...
@@ -82,27 +82,6 @@ pub struct BlurPlaceholderOptions {
pub
size
:
u32
,
}
fn
extension_to_image_format
(
extension
:
&
str
)
->
Option
<
ImageFormat
>
{
Some
(
match
extension
{
"avif"
=>
ImageFormat
::
Avif
,
"jpg"
|
"jpeg"
=>
ImageFormat
::
Jpeg
,
"png"
=>
ImageFormat
::
Png
,
"gif"
=>
ImageFormat
::
Gif
,
"webp"
=>
ImageFormat
::
WebP
,
"tif"
|
"tiff"
=>
ImageFormat
::
Tiff
,
"tga"
=>
ImageFormat
::
Tga
,
"dds"
=>
ImageFormat
::
Dds
,
"bmp"
=>
ImageFormat
::
Bmp
,
"ico"
=>
ImageFormat
::
Ico
,
"hdr"
=>
ImageFormat
::
Hdr
,
"exr"
=>
ImageFormat
::
OpenExr
,
"pbm"
|
"pam"
|
"ppm"
|
"pgm"
=>
ImageFormat
::
Pnm
,
"ff"
|
"farbfeld"
=>
ImageFormat
::
Farbfeld
,
"qoi"
=>
ImageFormat
::
Qoi
,
_
=>
return
None
,
})
}
fn
result_to_issue
<
T
>
(
source
:
ResolvedVc
<
Box
<
dyn
Source
>>
,
result
:
Result
<
T
>
)
->
Option
<
T
>
{
match
result
{
Ok
(
r
)
=>
Some
(
r
),
...
...
@@ -148,7 +127,7 @@ fn load_image_internal(
.context
(
"unable to determine image format from file content"
)
?
;
let
mut
format
=
reader
.format
();
if
format
.is_none
()
&&
let
Some
(
new_format
)
=
extension_to_image_format
(
extension
)
&&
let
Some
(
new_format
)
=
ImageFormat
::
from_extension
(
extension
)
{
format
=
Some
(
new_format
);
reader
.set_format
(
new_format
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment