WordPress.org

Make WordPress Core

Opened 2 months ago

Last modified 4 weeks ago

#53669 new defect (bug)

Respect the quality settings in `wp_editor_set_quality` for lossless WebP

Reported by: mikeschroder Owned by:
Milestone: 5.9 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 (4)

#1 follow-up: @desrosj
2 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.


2 months ago

#3 in reply to: ↑ 1 ; follow-up: @mikeschroder
2 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
4 weeks 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.

Note: See TracTickets for help on using tickets.