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

feat(image-jsx): automatic compression and transcoding for AVIF, WebP… #6161

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

xhcy1314
Copy link

@xhcy1314 xhcy1314 commented Apr 26, 2024

Automatic compression and transcoding for AVIF, WebP, and original formats.

Provides smaller image formats while ensuring proper display on low-end devices.

Overview

This commit enhances the image processing functionality. Now, the image tools automatically compress and transcode AVIF, WebP, and original formats, providing smaller image formats while ensuring proper display on low-end devices.

What is it?

  • Feature / enhancement
  • Bug
  • Docs / tests / types / typos

Description

This commit enhances the image processing functionality. Now, the image tools automatically compress and transcode AVIF, WebP, and original formats. It provides smaller image formats while ensuring proper display on low-end devices. This improvement contributes to enhancing user experience, particularly for users with lower-performance devices.

Use cases and why

    1. A single configuration allows selecting either AVIF, WebP, or PNG image formats. Choosing AVIF format will result in images not being displayed on devices that do not support AVIF.
    1. Similarly, selecting WebP format will result in images not being displayed on devices that do not support WebP.

Checklist:

  • My code follows the developer guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • Added new tests to cover the fix / functionality

…, and original formats

Provides smaller image formats while ensuring proper display on low-end devices.
Copy link
Member

@wmertens wmertens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is good but then you also need to change the jsx output so that it uses <picture> instead of <img>, because srcset doesn't let you tell the browser what the type is

https://stackoverflow.com/a/67698595/124416

@PatrickJS PatrickJS added the STATUS-3: no response The issue / PR creator has not responded for a while label May 6, 2024
@PatrickJS PatrickJS marked this pull request as draft May 6, 2024 05:44
@xhcy1314
Copy link
Author

xhcy1314 commented May 7, 2024

The idea is good but then you also need to change the jsx output so that it uses <picture> instead of <img>, because srcset doesn't let you tell the browser what the type is

https://stackoverflow.com/a/67698595/124416

I'll work on implementing it and testing its effectiveness as soon as possible. Thanks for the reminder!

@xhcy1314 xhcy1314 marked this pull request as ready for review May 7, 2024 13:05
@xhcy1314 xhcy1314 force-pushed the feat-imagetools-config-enhance branch from 3bec36a to 9de4ac0 Compare May 7, 2024 13:18
@xhcy1314 xhcy1314 requested a review from wmertens May 7, 2024 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
STATUS-3: no response The issue / PR creator has not responded for a while
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants