cloudflare / cloudflare/vinext

next/image: bypass AVIF input optimization by default

Open
#3,086 0 comments 0 reactions 0 assignees View on GitHub
nextjs-tracking
Dominant language
TypeScript
Stars
8.8k
Forks
406
Avg merge
2d 6h
Merged PRs (30d)
120

Description

## Next.js Change

**Commit:** [`7a5937a`](https://github.com/vercel/next.js/commit/7a5937a8ab20b89d0a961f75eabb11577f5d5998)
**PR:** [#97875](https://github.com/vercel/next.js/pull/97875)

## What changed

Next.js disables AVIF decoding and optimization by default because native image decoders may expose security risk. AVIF input is now served through unchanged, regardless of requested output format or size. Static AVIF imports no longer get an automatically generated blur placeholder; a caller-provided `blurDataURL` remains supported.

An explicit opt-in, `experimental.imgOptDangerouslyAllowAVIF`, restores AVIF input optimization and automatic blur generation.

## Impact on vinext

vinext exposes the `next/image` API and must match its public behavior where it provides image optimization or static-image metadata. Its configuration handling should also not reject the new opt-in configuration key.

What to check/do:

1. Determine whether vinext performs AVIF input decoding/optimization in any runtime or adapter. If so, bypass it by default and preserve the original AVIF response.
2. Support `experimental.imgOptDangerouslyAllowAVIF` only as an explicit opt-in for AVIF decoding/optimization.
3. For static AVIF imports, suppress automatic `placeholder="blur"` data unless `blurDataURL` was supplied by the application.
4. Add focused coverage for AVIF bypass, opt-in behavior, and static AVIF blur placeholders.

## Related

- Upstream image optimizer regression coverage in `test/e2e/image-optimizer/`

Contributor guide

Open the contributing guide

Research direction

Start by tracing vinext’s next/image implementation, image optimizer runtime or adapter, and configuration handling for AVIF decoding and static-image metadata. Use the upstream coverage in test/e2e/image-optimizer/ as a reference, then verify default AVIF passthrough, explicit experimental opt-in behavior, and blur placeholders only when blurDataURL is supplied.

Written by the indexing model from the issue text.

Assessment

Tech stack
next.js, typescript
Domain
performance, web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.