Title: image_downsize
Published: April 25, 2014
Last modified: May 20, 2026

---

# apply_filters( ‘image_downsize’, bool|array $downsize, int $id, string|int[] $size )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/image_downsize/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/hooks/image_downsize/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/image_downsize/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/image_downsize/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/image_downsize/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/hooks/image_downsize/?output_format=md#wp--skip-link--target)

Filters whether to preempt the output of [image_downsize()](https://developer.wordpress.org/reference/functions/image_downsize/).

## 󠀁[Description](https://developer.wordpress.org/reference/hooks/image_downsize/?output_format=md#description)󠁿

Returning a truthy value from the filter will effectively short-circuit down-sizing
the image, returning that value instead.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/image_downsize/?output_format=md#parameters)󠁿

 `$downsize`bool|array

Whether to short-circuit the image downsize.

`$id`int

Attachment ID for image.

`$size`string|int[]

Requested image size. Can be any registered image size name, or an array of width
and height values in pixels (in that order).

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/image_downsize/?output_format=md#source)󠁿

    ```php
    $out = apply_filters( 'image_downsize', false, $id, $size );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/media.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/media.php#L212)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/media.php#L212-L212)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/image_downsize/?output_format=md#related)󠁿

| Used by | Description | 
| [wp_prepare_attachment_for_js()](https://developer.wordpress.org/reference/functions/wp_prepare_attachment_for_js/)`wp-includes/media.php` |

Prepares an attachment post object for JS, where it is expected to be JSON-encoded and fit into an Attachment model.

  | 
| [image_downsize()](https://developer.wordpress.org/reference/functions/image_downsize/)`wp-includes/media.php` |

Scales an image to fit a particular size (such as ‘thumb’ or ‘medium’).

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/image_downsize/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.5.0](https://developer.wordpress.org/reference/since/2.5.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fimage_downsize%2F)
before being able to contribute a note or feedback.