diff --git a/wp-admin/includes/image-edit.php b/wp-admin/includes/image-edit.php
index e871ae5..1fe412a 100644
|
a
|
b
|
function wp_save_image($post_id) { |
| 630 | 630 | } |
| 631 | 631 | |
| 632 | 632 | $crop = $nocrop ? false : get_option("{$size}_crop"); |
| 633 | | $resized = image_make_intermediate_size($new_path, get_option("{$size}_size_w"), get_option("{$size}_size_h"), $crop ); |
| | 633 | $resized = image_make_intermediate_size($new_path, get_option("{$size}_size_w"), get_option("{$size}_size_h"), $crop, $size ); |
| 634 | 634 | |
| 635 | 635 | if ( $resized ) |
| 636 | 636 | $meta['sizes'][$size] = $resized; |
diff --git a/wp-admin/includes/image.php b/wp-admin/includes/image.php
index 44329c0..f2671b3 100644
|
a
|
b
|
function wp_generate_attachment_metadata( $attachment_id, $file ) { |
| 122 | 122 | $sizes = apply_filters( 'intermediate_image_sizes_advanced', $sizes ); |
| 123 | 123 | |
| 124 | 124 | foreach ($sizes as $size => $size_data ) { |
| 125 | | $resized = image_make_intermediate_size( $file, $size_data['width'], $size_data['height'], $size_data['crop'] ); |
| | 125 | $resized = image_make_intermediate_size( $file, $size_data['width'], $size_data['height'], $size_data['crop'], $size ); |
| 126 | 126 | if ( $resized ) |
| 127 | 127 | $metadata['sizes'][$size] = $resized; |
| 128 | 128 | } |
diff --git a/wp-includes/media.php b/wp-includes/media.php
index 5358b6e..67964b0 100644
|
a
|
b
|
function image_resize_dimensions($orig_w, $orig_h, $dest_w, $dest_h, $crop = fal |
| 402 | 402 | * @param int $jpeg_quality Optional, default is 90. Image quality percentage. |
| 403 | 403 | * @return mixed WP_Error on failure. String with new destination path. |
| 404 | 404 | */ |
| 405 | | function image_resize( $file, $max_w, $max_h, $crop = false, $suffix = null, $dest_path = null, $jpeg_quality = 90 ) { |
| | 405 | function image_resize( $file, $max_w, $max_h, $crop = false, $suffix = null, $dest_path = null, $jpeg_quality = 90, $size_name = '' ) { |
| 406 | 406 | |
| 407 | 407 | $image = wp_load_image( $file ); |
| 408 | 408 | if ( !is_resource( $image ) ) |
| … |
… |
function image_resize( $file, $max_w, $max_h, $crop = false, $suffix = null, $de |
| 426 | 426 | if ( IMAGETYPE_PNG == $orig_type && function_exists('imageistruecolor') && !imageistruecolor( $image ) ) |
| 427 | 427 | imagetruecolortopalette( $newimage, false, imagecolorstotal( $image ) ); |
| 428 | 428 | |
| | 429 | // apply size-specific filters to the image |
| | 430 | if ( $size_name ) |
| | 431 | $newimage = apply_filters( "image_resize_{$size_name}", $newimage ); |
| | 432 | |
| 429 | 433 | // we don't need the original in memory anymore |
| 430 | 434 | imagedestroy( $image ); |
| 431 | 435 | |
| … |
… |
function image_resize( $file, $max_w, $max_h, $crop = false, $suffix = null, $de |
| 433 | 437 | if ( !$suffix ) |
| 434 | 438 | $suffix = "{$dst_w}x{$dst_h}"; |
| 435 | 439 | |
| | 440 | // apply size-specific filters to the image suffix |
| | 441 | if ( $size_name ) |
| | 442 | $suffix = apply_filters( "image_resize_suffix_{$size_name}", $suffix ); |
| | 443 | |
| 436 | 444 | $info = pathinfo($file); |
| 437 | 445 | $dir = $info['dirname']; |
| 438 | 446 | $ext = $info['extension']; |
| … |
… |
function image_resize( $file, $max_w, $max_h, $crop = false, $suffix = null, $de |
| 477 | 485 | * @param int $width Image width. |
| 478 | 486 | * @param int $height Image height. |
| 479 | 487 | * @param bool $crop Optional, default is false. Whether to crop image to specified height and width or resize. |
| | 488 | * @param string $size Optional, default is ''. Size of image. |
| 480 | 489 | * @return bool|array False, if no image was created. Metadata array on success. |
| 481 | 490 | */ |
| 482 | | function image_make_intermediate_size($file, $width, $height, $crop=false) { |
| | 491 | function image_make_intermediate_size($file, $width, $height, $crop=false, $size = '' ) { |
| 483 | 492 | if ( $width || $height ) { |
| 484 | | $resized_file = image_resize($file, $width, $height, $crop); |
| | 493 | $resized_file = image_resize($file, $width, $height, $crop, null, null, 90, $size); |
| 485 | 494 | if ( !is_wp_error($resized_file) && $resized_file && $info = getimagesize($resized_file) ) { |
| 486 | 495 | $resized_file = apply_filters('image_make_intermediate_size', $resized_file); |
| 487 | 496 | return array( |