Skip to content

Conversation

@adamsilverstein
Copy link
Member

Summary

  • Improve settings when WebP support missing, or no when modern image support is available
  • Disable picture element form/description (at load) when JPEG output disabled
  • Dynamically toggle picture support form when JPEG output checkbox is toggled
  • Add a webp_uploads_is_generate_webp_and_jpeg_enabled helper

Fixes #1258

@adamsilverstein adamsilverstein added [Type] Enhancement A suggestion for improvement of an existing feature [Plugin] Modern Image Formats Issues for the Modern Image Formats plugin (formerly WebP Uploads) labels Jun 4, 2024
@adamsilverstein adamsilverstein added this to the webp-uploads 2.0.0 milestone Jun 4, 2024
@github-actions
Copy link

github-actions bot commented Jun 4, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: adamsilverstein <adamsilverstein@git.wordpress.org>
Co-authored-by: westonruter <westonruter@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@adamsilverstein
Copy link
Member Author

Adding some screenshots and a screencast:

No modern image formats supported:
no format supported

only avif supported:
only avif available

only WebP supported:
only webp available

screencast - toggling the JPEG output settings on and off
settings as gif

@adamsilverstein adamsilverstein changed the title Improve Settings->Media controls for Modern Images Improve Settings->Media controls for Modern Image Formats Jun 4, 2024
@westonruter
Copy link
Member

@adamsilverstein As for disabling the picture element checkbox when the JPEG output checkbox is disabled, what do you think about hiding the picture element row instead? See adamsilverstein#1

adamsilverstein and others added 6 commits June 4, 2024 13:12
Co-authored-by: Weston Ruter <westonruter@google.com>
Co-authored-by: Weston Ruter <westonruter@google.com>
Co-authored-by: Weston Ruter <westonruter@google.com>
Co-authored-by: Weston Ruter <westonruter@google.com>
Co-authored-by: Weston Ruter <westonruter@google.com>
Co-authored-by: Weston Ruter <westonruter@google.com>
…e-picture-row

* improve/image-settings:
  Update plugins/webp-uploads/settings.php
  Update plugins/webp-uploads/settings.php
  Update plugins/webp-uploads/settings.php
  Update plugins/webp-uploads/settings.php
  Update plugins/webp-uploads/helper.php
  Update plugins/webp-uploads/settings.php
  Update plugins/webp-uploads/settings.php
@westonruter
Copy link
Member

Maybe we can hide just the right column (checkbox/label/description) and replace it with a bit of text that says something like "JPEG fallback required to enable picture element" or something like that?

I like that idea. Like this? adamsilverstein#1 (comment)

adamsilverstein and others added 5 commits June 4, 2024 14:21
Co-authored-by: Weston Ruter <westonruter@google.com>
…e-picture-row

* improve/image-settings:
  Update plugins/webp-uploads/settings.php
  Complete rename of webp_uploads_is_generate_webp_and_jpeg_enabled -> webp_uploads_is_jpeg_fallback_enabled
…ure-row

Show notice with picture element field
Copy link
Member

@westonruter westonruter left a comment

Choose a reason for hiding this comment

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

Just a couple more nits, but I'm pre-approving otherwise!

@westonruter westonruter requested a review from joemcgill June 4, 2024 21:15
westonruter and others added 5 commits June 4, 2024 14:20
Co-authored-by: Weston Ruter <westonruter@google.com>
Co-authored-by: Weston Ruter <westonruter@google.com>
Co-authored-by: Weston Ruter <westonruter@google.com>
@adamsilverstein
Copy link
Member Author

Just a couple more nits, but I'm pre-approving otherwise!

Great, thanks for the feedback.

Copy link
Member

@joemcgill joemcgill left a comment

Choose a reason for hiding this comment

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

Untested, but the code looks right to me. Nice update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Plugin] Modern Image Formats Issues for the Modern Image Formats plugin (formerly WebP Uploads) [Type] Enhancement A suggestion for improvement of an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve Settings for Modern Image Formats

3 participants