Make WordPress Core

Opened 2 years ago

Last modified 20 months ago

#56344 assigned feature request

Filters for Sharpening Images

Reported by: unsalkorkmaz's profile unsalkorkmaz Owned by: antpb's profile antpb
Milestone: Future Release Priority: normal
Severity: normal Version: 4.5
Component: Media Keywords: needs-patch changes-requested needs-unit-tests
Focuses: Cc:

Description

Hello,

Can you add filters for these numbers;

https://github.com/WordPress/wordpress-develop/blob/67023d0c66267420107bb565f887ae6a95b12666/src/wp-includes/class-wp-image-editor-imagick.php#L383

And GD version needs some sharpen job too, I believe.

Attachments (2)

56344-1.patch (847 bytes) - added by antpb 21 months ago.
56344-2.patch (1.4 KB) - added by antpb 21 months ago.

Download all attachments as: .zip

Change History (17)

#1 @desrosj
2 years ago

  • Version trunk deleted

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


2 years ago

#3 @antpb
2 years ago

  • Milestone changed from Awaiting Review to 6.2

Moving to 6.2. This change seems minimally impacting so it should be no problem to let those values be adjusted.

@joedolson mentioned in the recent Media meeting that we should investigate having an array of all values like compression level, filter, strategy, unsharp settings, etc. that can be filtered. If any values are missing, just use defaults.

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


2 years ago

#5 @nosilver4u
23 months ago

FYI, this was already requested in #55036
and as @galbaras mentioned, we implemented it in the EWWW Image Optimizer plugin along with the adaptiveSharpenImage() method in EWWW Image Optimizer, so feel free to yank code from there:

https://github.com/nosilver4u/ewww-image-optimizer/blob/6ee2b5527ee537209275eafd8e7d96f5bbd041b7/classes/class-ewwwio-imagick-editor.php#L361

As far as GD, I don't know that such a thing is possible, and we always tell our users to enable Imagick if possible, which I believe aligns with the advice on the WP Site Health screen for folks using GD.

This ticket was mentioned in Slack in #core by mukeshpanchal27. View the logs.


21 months ago

#7 @mukesh27
21 months ago

  • Keywords needs-patch added

#8 @mukesh27
21 months ago

  • Version set to 4.5

This ticket was discussed in the recent bug scrub.

@antpb, do you think this ticket is likely to move forward during this cycle?

Props to @costdev

@antpb
21 months ago

@antpb
21 months ago

#9 @antpb
21 months ago

  • Owner set to antpb
  • Status changed from new to assigned

thanks @mukesh27 I added a draft patch for discussion tomorrow.

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


21 months ago

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


21 months ago

#12 @antpb
21 months ago

  • Keywords changes-requested added

noting, this patch is going to be refreshed with validation for the min/max that the values should be with fallbacks to the default.

+ props @joemcgill on the suggestion.

Last edited 21 months ago by antpb (previous) (diff)

#13 @antpb
21 months ago

leaving a note also that we should make this filter name specifically mention imagick as this only impacts that configuration. + props @joedolson on the suggestion.

This ticket was mentioned in Slack in #core by mukeshpanchal27. View the logs.


20 months ago

#15 @costdev
20 months ago

  • Keywords needs-unit-tests added
  • Milestone changed from 6.2 to Future Release

This ticket was discussed during the bug scrub. As this ticket still needs some work and 6.2 Beta 1 is being released today, I'll move this to Future Release.

The patch could also do with a couple of unit tests to verify that the filter is only called when expected, and that the returned values are validated. Adding needs-unit-tests.

Additional props: @mukesh27

Note: See TracTickets for help on using tickets.