image_editor_output_format

image_editor_output_format

Hook Type: filter

See hook in core

Displaying hooks found in version: wordpress-6.5.2

apply_filters('image_editor_output_format') is found 3 times:

  • /wp-includes/class-wp-image-editor.php line 388
    		 * }
    		 * @param string $filename  Path to the image.
    		 * @param string $mime_type The source image mime type.
    		 */
    		$output_format = apply_filters( 'image_editor_output_format', array(), $filename, $mime_type );
    
    		if ( isset( $output_format[ $mime_type ] )
    			&& $this->supports_mime_type( $output_format[ $mime_type ] )
    		) {
    			$mime_type = $output_format[ $mime_type ];
    			$new_ext   = $this->get_extension( $mime_type );
    
  • /wp-includes/functions.php line 2708
    		 * when regenerated. If yes, ensure the new file name will be unique and will produce unique sub-sizes.
    		 */
    		if ( $is_image ) {
    			/** This filter is documented in wp-includes/class-wp-image-editor.php */
    			$output_formats = apply_filters( 'image_editor_output_format', array(), $_dir . $filename, $mime_type );
    			$alt_types      = array();
    
    			if ( ! empty( $output_formats[ $mime_type ] ) ) {
    				// The image will be converted to this format/mime type.
    				$alt_mime_type = $output_formats[ $mime_type ];
    
    
  • /wp-includes/media.php line 4061
     
    	// Check and set the output mime type mapped to the input type.
    	if ( isset( $args['mime_type'] ) ) {
    		/** This filter is documented in wp-includes/class-wp-image-editor.php */
    		$output_format = apply_filters( 'image_editor_output_format', array(), $path, $args['mime_type'] );
    		if ( isset( $output_format[ $args['mime_type'] ] ) ) {
    			$args['output_mime_type'] = $output_format[ $args['mime_type'] ];
    		}
    	}
    
    	$implementation = _wp_image_editor_choose( $args );