protected function get_output_format( $filename = null,
$mime_type = null
) { $new_ext = null;
// By default, assume specified type takes priority.
if ( $mime_type ) { $new_ext =
$this->
get_extension( $mime_type );
} if ( $filename ) { $file_ext =
strtolower( pathinfo( $filename, PATHINFO_EXTENSION
) );
$file_mime =
$this->
get_mime_type( $file_ext );
} else { // If no file specified, grab editor's current extension and mime-type.
$file_ext =
strtolower( pathinfo( $this->file, PATHINFO_EXTENSION
) );
$file_mime =
$this->mime_type;
} /*
* Check to see if specified mime-type is the same as type implied by
* file extension. If so, prefer extension from file.
*/
if ( !
$mime_type || ( $file_mime ==
$mime_type ) ) {