protected $mime_type = null;
protected $default_mime_type = 'image/jpeg';
protected $quality = false;
- protected $default_quality = 90;
+ protected $default_quality = 82;
/**
* Each instance handles a single file.
+ *
+ * @param string $file Path to the file to load.
*/
public function __construct( $file ) {
$this->file = $file;
public function set_quality( $quality = null ) {
if ( null === $quality ) {
/**
- * Filter the default image compression quality setting.
+ * Filters the default image compression quality setting.
*
* Applies only during initial editor instantiation, or when set_quality() is run
* manually without the `$quality` argument.
if ( 'image/jpeg' == $this->mime_type ) {
/**
- * Filter the JPEG compression quality for backward-compatibility.
+ * Filters the JPEG compression quality for backward-compatibility.
*
* Applies only during initial editor instantiation, or when set_quality() is run
* manually without the `$quality` argument.
}
}
- // Allow 0, but squash to 1 due to identical images in GD, and for backwards compatibility.
+ // Allow 0, but squash to 1 due to identical images in GD, and for backward compatibility.
if ( 0 === $quality ) {
$quality = 1;
}
// If not, choose a default instead.
if ( ! $this->supports_mime_type( $mime_type ) ) {
/**
- * Filter default mime type prior to getting the file extension.
+ * Filters default mime type prior to getting the file extension.
*
* @see wp_get_mime_types()
*