Changeset 26645 for trunk/src/wp-includes/class-wp-image-editor-gd.php
- Timestamp:
- 12/04/2013 10:48:45 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-image-editor-gd.php
r25728 r26645 78 78 * @access protected 79 79 * 80 * @return boolean| \WP_Error80 * @return boolean|WP_Error True if loaded successfully; WP_Error on failure. 81 81 */ 82 82 public function load() { … … 87 87 return new WP_Error( 'error_loading_image', __('File doesn’t exist?'), $this->file ); 88 88 89 /** 90 * Filter the memory limit allocated for image manipulation. 91 * 92 * @since 3.5.0 93 * 94 * @param int Maximum memory limit to allocate (default is WP_MAX_MEMORY_LIMIT) 95 */ 89 96 // Set artificially high because GD uses uncompressed images in memory 90 97 @ini_set( 'memory_limit', apply_filters( 'image_memory_limit', WP_MAX_MEMORY_LIMIT ) ); 98 91 99 $this->image = @imagecreatefromstring( file_get_contents( $this->file ) ); 92 100 … … 106 114 $this->mime_type = $size['mime']; 107 115 108 return true;116 return $this->set_quality( $this->quality ); 109 117 } 110 118 … … 362 370 } 363 371 elseif ( 'image/jpeg' == $mime_type ) { 364 if ( ! $this->make_image( $filename, 'imagejpeg', array( $image, $filename, apply_filters( 'jpeg_quality', $this->quality, 'image_resize' ) ) ) )372 if ( ! $this->make_image( $filename, 'imagejpeg', array( $image, $filename, $this->quality ) ) ) 365 373 return new WP_Error( 'image_save_error', __('Image Editor Save Failed') ); 366 374 } … … 374 382 @ chmod( $filename, $perms ); 375 383 384 /** 385 * Filter the name of the saved image file. 386 * 387 * @since 2.6.0 388 * 389 * @param string $filename Name of the file. 390 */ 376 391 return array( 377 'path' => $filename,378 'file' => wp_basename( apply_filters( 'image_make_intermediate_size', $filename ) ),379 'width' => $this->size['width'],380 'height' => $this->size['height'],381 'mime-type' => $mime_type,392 'path' => $filename, 393 'file' => wp_basename( apply_filters( 'image_make_intermediate_size', $filename ) ), 394 'width' => $this->size['width'], 395 'height' => $this->size['height'], 396 'mime-type' => $mime_type, 382 397 ); 383 398 }
Note: See TracChangeset
for help on using the changeset viewer.