// Select the first frame to handle animated images properly.
if ( is_callable( array
( $this->image, 'setIteratorIndex'
) ) ) { $this->image->
setIteratorIndex( 0
);
} $this->mime_type =
$this->
get_mime_type( $this->image->
getImageFormat() );
} catch ( Exception
$e ) { return new WP_Error( 'invalid_image',
$e->
getMessage(),
$this->file
);
} $updated_size =
$this->
update_size();
if ( is_wp_error( $updated_size ) ) { return $updated_size;
} return $this->
set_quality();
} /**
* Sets Image Compression quality on a 1-100% scale.
*
* @since 3.5.0
*
* @param int $quality Compression Quality. Range: [1,100]
* @return true|WP_Error True if set successfully; WP_Error on failure.
*/