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

[gatsby-remark-images] with withAvif return wrong "srcSetType" for generated Avif images #29757

Closed
hendra-go opened this issue Feb 25, 2021 · 2 comments
Labels
topic: remark/mdx Related to Markdown, remark & MDX ecosystem type: bug An issue or pull request relating to a bug in Gatsby

Comments

@hendra-go
Copy link
Contributor

Description

[gatsby-remark-images] with withAvif return wrong "srcSetType" for generated Avif images

image

Steps to reproduce

Develop any gatsby project using gatsby-remark-images with withAvif set to true in gatsby-config.js

Expected result

The image type should be image/avif
Image loaded and displayed in all browser that support avif

Actual result

The currently image type is image/jpeg
and image not shown in mobile browser (tested with latest chrome for android) even though the browser support avif, but apparently still shown in desktop browser that support avif

Environment

  System:
    OS: Windows 10 10.0.19042
    CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
  Binaries:
    Node: 14.15.5 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.10 - ~\AppData\Local\Yarn\bin\yarn.CMD
    npm: 6.14.11 - C:\Program Files\nodejs\npm.CMD
  Languages:
    Python: 3.9.2 - /cygdrive/c/Python39/python
  Browsers:
    Chrome: 88.0.4324.190
    Edge: Spartan (44.19041.423.0), Chromium (88.0.705.74)
...
@hendra-go hendra-go added the type: bug An issue or pull request relating to a bug in Gatsby label Feb 25, 2021
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Feb 25, 2021
@hendra-go
Copy link
Contributor Author

hendra-go commented Feb 25, 2021

The culprit actually lies in gatsby-plugin-sharp.

I have created pull request for quick fix

PR #29758

And i have confirmed that avif image now shown in mobile browser

@hendra-go
Copy link
Contributor Author

Additional:
If you use your own http server pleas,e add image/avif to your mime types if not exist

@LekoArts LekoArts added topic: remark/mdx Related to Markdown, remark & MDX ecosystem and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Feb 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: remark/mdx Related to Markdown, remark & MDX ecosystem type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

2 participants