Title: image_make_intermediate_size
Last modified: August 19, 2016

---

# image_make_intermediate_size

 *  [mores](https://wordpress.org/support/users/mores/)
 * (@mores)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/image_make_intermediate_size/)
 * Hello,
 * I just realized there is a way to get medium sized images to be zoomcropped to
   fit the exact measurements you set in your WordPress options.
 * Now, I’d like to make this optional.
    If it’s a landscape mode pic, zoomcrop 
   it, if it’s a portrait mode, then don’t.
 * I believe it has something to do with `image_make_intermediate_size`. Now, I 
   don’t want to edit any core files, so I’m looking for a way to hook into that
   and do some height/width calculations before it’s being executed.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [mores](https://wordpress.org/support/users/mores/)
 * (@mores)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/image_make_intermediate_size/#post-999647)
 * I tried using this in my functions.php:
 *     ```
       function dm_image_make_intermediate_size($file, $width, $height, $crop=false) {
       	if ( $width || $height ) {
       		if ($width >> $height) {$crop=true;}
       		$resized_file = image_resize($file, $width, $height, $crop);
       		if ( !is_wp_error($resized_file) && $resized_file && $info = getimagesize($resized_file) ) {
       			$resized_file = apply_filters('image_make_intermediate_size', $resized_file);
       			return array(
       				'file' => basename( $resized_file ),
       				'width' => $info[0],
       				'height' => $info[1],
       			);
       		}
       	}
       	return false;
       }
       add_filter('image_make_intermediate_size', 'dm_image_make_intermediate_size', 11, 4);
       ```
   
 * But I get an error message saying there’s parameter 2 and 3 missing.
 *  [Raul P.](https://wordpress.org/support/users/alignak/)
 * (@alignak)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/image_make_intermediate_size/#post-999848)
 * well, I’m having the same problem…
    Have you figure it out yet?

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘image_make_intermediate_size’ is closed to new replies.

## Tags

 * [crop](https://wordpress.org/support/topic-tag/crop/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [Raul P.](https://wordpress.org/support/users/alignak/)
 * Last activity: [17 years, 3 months ago](https://wordpress.org/support/topic/image_make_intermediate_size/#post-999848)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
