nuxt / nuxt/image

Transparency not detected when image url doesn't contain an extension

Open
#368 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.5k
Forks
331
Avg merge
19h 52m
Merged PRs (30d)
9

Description

Hello!

I'm using nuxt in full static mode with directus as a content source.
Directus has a media library which provides a path to display the files. The path is built as follows:
http://[directus-url]/assets/[FILE_ID]
ex: http://localhost:8055/assets/db6b1d10-3ab0-4c20-a088-0f0246ae3145

When using nuxt-picture with that url as src, it renders a transparent webp as expected but the fallback generated is a .jpeg with a black background.

I tested with a local path to the file /assets/image.png and a distant path containing the .png extension and all is working fine.

Is it an expected behaviour?
Thanks!

nuxt v2.15.7
nuxt-img v0.5.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source files or tests are named. Start by reproducing the fallback generation with a Directus-style image URL that has no extension, then compare it with local and extension-bearing URLs. Done means the fallback for a transparent image without an extension no longer receives a black background.

Written by the indexing model from the issue text.

Assessment

Tech stack
nuxt, typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.