WordPress.org

Make WordPress Core

Opened 5 months ago

Last modified 12 days ago

#53669 new defect (bug)

Respect the quality settings in `wp_editor_set_quality` for lossless WebP

Reported by: mikeschroder Owned by:
Milestone: 6.0 Priority: normal
Severity: normal Version: 5.8
Component: Media Keywords: needs-patch
Focuses: Cc:

Description

In Imagick, WordPress now supports saving lossless WebP images when the source is a lossless WebP image. 🎉

This happens inside the Imagick editor in `set_quality`.

The filter, wp_editor_set_quality, applies before this is run, in the parent class.

This means that if a WebP is detected as Lossless, it isn't possible to override lossless thumbnailing with wp_editor_set_quality.

WordPress should respect the wp_editor_set_quality filter's override, unless `set_quality()` is run manually.

Change History (6)

#1 follow-up: @desrosj
5 months ago

  • Milestone changed from Awaiting Review to Future Release

It seems like having lossy and lossless may be a thing of the future. In addition to WebP, JPEG XL appears to also support both.

If this is the case, I think adding an additional quality filter for compression makes sense.

  • wp_editor_set_quality for the compression within the image editing tool of choice.
  • wp_image_compression for lossy, lossless, or null when the format does not differentiate with the default being the same as the original uploaded image.

This ticket was mentioned in Slack in #core-media by desrosj. View the logs.


5 months ago

#3 in reply to: ↑ 1 ; follow-up: @mikeschroder
4 months ago

Replying to desrosj:

It seems like having lossy and lossless may be a thing of the future. In addition to WebP, JPEG XL appears to also support both.

If this is the case, I think adding an additional quality filter for compression makes sense.

  • wp_editor_set_quality for the compression within the image editing tool of choice.
  • wp_image_compression for lossy, lossless, or null when the format does not differentiate with the default being the same as the original uploaded image.

Looks like AVIF supports lossless as well!

I like this proposal / direction.

#4 in reply to: ↑ 3 @azaozz
3 months ago

  • Milestone changed from Future Release to 5.9

Replying to mikeschroder:

I like this proposal / direction.

Same here.

Lets try to add that in 5.9. Would be pretty nice to use when converting uploaded images to WebP or lossless to lossy.

This ticket was mentioned in Slack in #core-media by antpb. View the logs.


2 weeks ago

#6 @hellofromTonya
12 days ago

  • Milestone changed from 5.9 to 6.0

5.9 Beta 1 release is happening in a few hours. With no patch or activity, moving it to 6.0.

Note: See TracTickets for help on using tickets.