Make WordPress Core

Ticket #26177: 26177.patch

File 26177.patch, 3.1 KB (added by theorboman, 12 years ago)

Patch for inline docs

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

     
    8787                        return new WP_Error( 'error_loading_image', __('File doesn’t exist?'), $this->file );
    8888
    8989                // Set artificially high because GD uses uncompressed images in memory
     90                /** This filter is documented in wp-includes/class-wp-image-editor-imagick.php */
    9091                @ini_set( 'memory_limit', apply_filters( 'image_memory_limit', WP_MAX_MEMORY_LIMIT ) );
    9192                $this->image = @imagecreatefromstring( file_get_contents( $this->file ) );
    9293
     
    361362                                return new WP_Error( 'image_save_error', __('Image Editor Save Failed') );
    362363                }
    363364                elseif ( 'image/jpeg' == $mime_type ) {
     365                        /** This filter is documented in wp-includes/class-wp-image-editor-imagick.php */
    364366                        if ( ! $this->make_image( $filename, 'imagejpeg', array( $image, $filename, apply_filters( 'jpeg_quality', $this->quality, 'image_resize' ) ) ) )
    365367                                return new WP_Error( 'image_save_error', __('Image Editor Save Failed') );
    366368                }
     
    375377
    376378                return array(
    377379                        'path' => $filename,
     380                        /** This filter is documented in wp-includes/class-wp-image-editor-imagick.php */
    378381                        'file' => wp_basename( apply_filters( 'image_make_intermediate_size', $filename ) ),
    379382                        'width' => $this->size['width'],
    380383                        'height' => $this->size['height'],
  • wp-includes/class-wp-image-editor-imagick.php

     
    119119                if ( ! is_file( $this->file ) && ! preg_match( '|^https?://|', $this->file ) )
    120120                        return new WP_Error( 'error_loading_image', __('File doesn’t exist?'), $this->file );
    121121
     122                /**
     123                 * Filter the memory limit allocated to either GD or Imagick for image manipulation.
     124                 *
     125                 * @since 3.2.0
     126                 *
     127                 * @param string Maximum memory limit to allocate (default is 256M).
     128                 */
    122129                // Even though Imagick uses less PHP memory than GD, set higher limit for users that have low PHP.ini limits
    123130                @ini_set( 'memory_limit', apply_filters( 'image_memory_limit', WP_MAX_MEMORY_LIMIT ) );
    124131
     
    160167
    161168                try {
    162169                        if( 'image/jpeg' == $this->mime_type ) {
     170                                /**
     171                                 * Filter the quality of the JPEG before it's saved.
     172                                 *
     173                                 * @since 2.5.0
     174                                 *
     175                                 * @param int           $quality        Quality level between 0 (low) and 100 (high) of the JPEG.
     176                                 * @param string                                The context of the filter.
     177                                 */
    163178                                $this->image->setImageCompressionQuality( apply_filters( 'jpeg_quality', $quality, 'image_resize' ) );
    164179                                $this->image->setImageCompression( imagick::COMPRESSION_JPEG );
    165180                        }
     
    449464
    450465                return array(
    451466                        'path' => $filename,
     467                        /**
     468                         * Filter the name of the saved image file.
     469                         *
     470                         * @since 2.6.0
     471                         *
     472                         * @param string $filename Name of the file.
     473                         */
    452474                        'file' => wp_basename( apply_filters( 'image_make_intermediate_size', $filename ) ),
    453475                        'width' => $this->size['width'],
    454476                        'height' => $this->size['height'],