WordPress.org

Make WordPress Core

Ticket #21668: 21668.3.diff

File 21668.3.diff, 1.4 KB (added by Japh, 6 years ago)

Refreshed patch for 3.5

  • wp-includes/class-wp-image-editor-gd.php

     
    300300                if ( ! $filename )
    301301                        $filename = $this->generate_filename( null, null, $extension );
    302302
     303                if ( function_exists( 'imageinterlace' ) )
     304                        imageinterlace( $image, apply_filters( 'image_save_progressive', 0, $mime_type ) );
     305
    303306                if ( 'image/gif' == $mime_type ) {
    304307                        if ( ! $this->make_image( $filename, 'imagegif', array( $image, $filename ) ) )
    305308                                return new WP_Error( 'image_save_error', __('Image Editor Save Failed') );
  • wp-includes/class-wp-image-editor-imagick.php

     
    358358                        $orig_format = $this->image->getImageFormat();
    359359
    360360                        $this->image->setImageFormat( strtoupper( $this->get_extension( $mime_type ) ) );
     361
     362                        $interlace = apply_filters( 'image_save_progressive', 0, $mime_type );
     363                        if ( $interlace ) {
     364                                $this->image->setImageInterlaceScheme( strtoupper( $mime_type ) == 'PNG' ? Imagick::INTERLACE_PLANE : Imagick::INTERLACE_LINE );
     365                        }
     366
    361367                        $this->make_image( $filename, array( $image, 'writeImage' ), array( $filename ) );
    362368
    363369                        // Reset original Format