get_output_format( $filename, $mime_type ); if ( ! $filename ) { $filename = $this->generate_filename( null, null, $extension ); } if ( ( ! defined( 'EWWWIO_EDITOR_OVERWRITE' ) || ! EWWWIO_EDITOR_OVERWRITE ) && ewwwio_is_file( $filename ) ) { ewwwio_debug_message( "detected existing file: $filename" ); $current_size = wp_getimagesize( $filename ); if ( $current_size && (int) $this->size['width'] === (int) $current_size[0] && (int) $this->size['height'] === (int) $current_size[1] ) { ewwwio_debug_message( "existing file has same dimensions, not saving $filename" ); return array( 'path' => $filename, 'file' => wp_basename( apply_filters( 'image_make_intermediate_size', $filename ) ), 'width' => $this->size['width'], 'height' => $this->size['height'], 'mime-type' => $mime_type, ); } } $saved = parent::_save( $image, $filename, $mime_type ); if ( ! is_wp_error( $saved ) ) { if ( ! $filename ) { $filename = $saved['path']; } if ( file_exists( $filename ) ) { ewww_image_optimizer( $filename ); ewwwio_debug_message( "image editor (gmagick) saved: $filename" ); $image_size = ewww_image_optimizer_filesize( $filename ); ewwwio_debug_message( "image editor size: $image_size" ); } } ewwwio_memory( __FUNCTION__ ); return $saved; } } } // End if().