WordPress.org

Make WordPress Core

Opened 16 months ago

Last modified 16 months ago

#40087 new feature request

Add ability to filter Imagemagick processing options

Reported by: aesqe Owned by:
Milestone: Awaiting Review Priority: normal
Severity: trivial Version: 4.7.3
Component: Media Keywords: dev-feedback
Focuses: Cc:

Description

Hi everyone :)

TLDR: I want to be able to control Imagemagick's sampling factor value for JPEG images.

I haven't been able to find any info on whether it's possible to change this value in Imagemagick's defaults, and there don't seem to be any usable filters or actions in WP_Image_Editor_Imagick class.

To be able to set the sampling factor, one needs access to the Imagemagick instance, which is a protected var in the editor class, I guess for a reason.

Options:

a) a new public WP_Image_Editor_Imagick method which would be able to call Imagemagick instance methods, made available via an add_action call b) add something like the following code to the set_quality method:

if( defined("IMAGICK_SAMPLING_FACTOR") ) {
    $this->image->setImageProperty('jpeg:sampling-factor', IMAGICK_SAMPLING_FACTOR);
}

Any ideas?

Thanks!

Change History (1)

#1 @aesqe
16 months ago

  • Keywords dev-feedback added
  • Severity changed from normal to trivial
Note: See TracTickets for help on using tickets.