Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebP image have .png extension ? #723

Closed
mrleblanc101 opened this issue Jan 27, 2023 · 1 comment
Closed

WebP image have .png extension ? #723

mrleblanc101 opened this issue Jan 27, 2023 · 1 comment

Comments

@mrleblanc101
Copy link

mrleblanc101 commented Jan 27, 2023

Is it normal when using <NuxtPicture> (in dev mode since SSG is currently broken) that the src of the type="image/webp" image has the png extension?

<picture class="max-h-full relative -z-10 ml-auto -mb-4 w-1/2 max-w-md md:max-w-none object-contain object-right-bottom pt-8 min-w-[250px]">
    <source type="image/webp" sizes="(max-width: 640px) 250px, (max-width: 768px) 50vw, (max-width: 1024px) 50vw, 608px" srcset="/_ipx/f_webp,s_250x335/img/profil.png 250w, /_ipx/f_webp,s_384x514/img/profil.png 384w, /_ipx/f_webp,s_512x685/img/profil.png 512w, /_ipx/f_webp,s_608x814/img/profil.png 608w">
    <img width="1537" height="2057" alt="Photo de Sébastien LeBlanc" src="/_ipx/f_png,s_608x814/img/profil.png" sizes="(max-width: 640px) 250px, (max-width: 768px) 50vw, (max-width: 1024px) 50vw, 608px" srcset="/_ipx/f_png,s_250x335/img/profil.png 250w, /_ipx/f_png,s_384x514/img/profil.png 384w, /_ipx/f_png,s_512x685/img/profil.png 512w, /_ipx/f_png,s_608x814/img/profil.png 608w">
</picture>

Now I'm not sure if the image is actually a PNG or a WebP
Capture_decran_le_2023-01-24_a_21 43 35

@pi0
Copy link
Member

pi0 commented Jan 27, 2023

Hi dear @mrleblanc101. This is expected (and generally fine by browsers). The image path simply ends with source while contents that determines mime is based on transformation (notice f_webp). Browsers pick the right mime to render.

However this is confusing! I have opened a discussion in #726 to follow up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants