[wp-trac] [WordPress Trac] #40415: Imagick resize filter hook
WordPress Trac
noreply at wordpress.org
Tue Apr 11 16:57:09 UTC 2017
#40415: Imagick resize filter hook
-------------------------+-----------------------------
Reporter: virgodesign | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 4.7.3
Severity: normal | Keywords:
Focuses: |
-------------------------+-----------------------------
As of ticket #33642, Wordpress 4.5 introduces the `thumbnail_image()`
function within the `WP_Image_Editor_Imagick` class.
This function uses the default imagick filter `FILTER_TRIANGLE` to assists
the image resizing process.
Within the `thumbnail_image()` is even declared a list of allowed filters
that actually are absolute unsued due to the fact that wordpress uses only
the default filter `FILTER_TRIANGLE`. The filter list is
{{{
'FILTER_POINT'
'FILTER_BOX'
'FILTER_TRIANGLE'
'FILTER_HERMITE'
'FILTER_HANNING'
'FILTER_HAMMING'
'FILTER_BLACKMAN'
'FILTER_GAUSSIAN'
'FILTER_QUADRATIC'
'FILTER_CUBIC'
'FILTER_CATROM'
'FILTER_MITCHELL'
'FILTER_LANCZOS'
'FILTER_BESSEL'
'FILTER_SINC'
}}}
Resizing image using the default filter often gives as a result a softly
blurry thumbnail image. this blur effect became more visible as the
thumbnail size increase.
Using filter like `FILTER_HAMMING` or `FILTER_SINC` the blur effect
disappear, giving a great resizing result.
To better improve the use of the resizing process and to give any users
the ability to choose which type of filter to use, I think that could be
implemented the following filter hook:
{{{
$filter_name = apply_filters('image_resize_filter', $filter_name);
}}}
that will give an opportunity to change this filter before the resizing
process will perform.
This filter should be implemented at the beginning (line 1) of the
`thumbnail_image()` function.
This way everyone can, optionally, change the imagick resize filter
easily.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40415>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list