| 3 | | // functions for media display |
| 4 | | |
| 5 | | // scale down the default size of an image so it's a better fit for the editor and theme |
| | 8 | /** |
| | 9 | * Scale down the default size of an image. |
| | 10 | * |
| | 11 | * This is so that the image is a better fit for the editor and theme. |
| | 12 | * |
| | 13 | * The $size parameter accepts either an array or a string. The supported string |
| | 14 | * values are 'thumb' or 'thumbnail' for the given thumbnail size or defaults at |
| | 15 | * 128 width and 96 height in pixels. Also supported for the string value is |
| | 16 | * 'medium' and 'full'. The 'full' isn't actually supported, but any value other |
| | 17 | * than the supported will result in the content_width size or 500 if that is |
| | 18 | * not set. |
| | 19 | * |
| | 20 | * Finally, there is a filter named, 'editor_max_image_size' that will be called |
| | 21 | * on the calculated array for width and height, respectively. The second |
| | 22 | * parameter will be the value that was in the $size parameter. The returned |
| | 23 | * type for the hook is an array with the width as the first element and the |
| | 24 | * height as the second element. |
| | 25 | * |
| | 26 | * @since 2.5.0 |
| | 27 | * @uses wp_constrain_dimensions() This function passes the widths and the heights. |
| | 28 | * |
| | 29 | * @param int $width Width of the image |
| | 30 | * @param int $height Height of the image |
| | 31 | * @param string|array $size Size of what the result image should be. |
| | 32 | * @return array Width and height of what the result image should resize to. |
| | 33 | */ |
| 47 | | // return a width/height string for use in an <img /> tag. Empty values will be omitted. |
| | 75 | /** |
| | 76 | * Retrieve width and height attributes using given width and height values. |
| | 77 | * |
| | 78 | * Both attributes are required in the sense that both parameters must have a |
| | 79 | * value, but are optional in that if you set them to false or null, then they |
| | 80 | * will not be added to the returned string. |
| | 81 | * |
| | 82 | * You can set the value using a string, but it will only take numeric values. |
| | 83 | * If you wish to put 'px' after the numbers, then it will be stripped out of |
| | 84 | * the return. |
| | 85 | * |
| | 86 | * @since 2.5.0 |
| | 87 | * |
| | 88 | * @param int|string $width Optional. Width attribute value. |
| | 89 | * @param int|string $height Optional. Height attribute value. |
| | 90 | * @return string HTML attributes for width and, or height. |
| | 91 | */ |
| 57 | | // Scale an image to fit a particular size (such as 'thumb' or 'medium'), and return an image URL, height and width. |
| 58 | | // The URL might be the original image, or it might be a resized version. This function won't create a new resized copy, it will just return an already resized one if it exists. |
| 59 | | // returns an array($url, $width, $height, $is_intermediate) |
| 60 | | // $is_intermediate is true if $url is a resized image, false if it is the original |
| | 101 | /** |
| | 102 | * Scale an image to fit a particular size (such as 'thumb' or 'medium'). |
| | 103 | * |
| | 104 | * Array with image url, width, height, and whether is intermediate size, in |
| | 105 | * that order is returned on success is returned. $is_intermediate is true if |
| | 106 | * $url is a resized image, false if it is the original. |
| | 107 | * |
| | 108 | * The URL might be the original image, or it might be a resized version. This |
| | 109 | * function won't create a new resized copy, it will just return an already |
| | 110 | * resized one if it exists. |
| | 111 | * |
| | 112 | * @since 2.5.0 |
| | 113 | * @uses apply_filters() Calls 'image_downsize' on $id and $size to provide |
| | 114 | * resize services. Should return true if resizes. |
| | 115 | * |
| | 116 | * @param int $id Attachment ID for image. |
| | 117 | * @param string $size Optional, default is 'medium'. Size of image, can be 'thumbnail'. |
| | 118 | * @return bool|array False on failure, array on success. |
| | 119 | */ |
| 210 | | // Scale down an image to fit a particular size and save a new copy of the image |
| | 271 | /** |
| | 272 | * Scale down an image to fit a particular size and save a new copy of the image. |
| | 273 | * |
| | 274 | * @param unknown_type $file |
| | 275 | * @param unknown_type $max_w |
| | 276 | * @param unknown_type $max_h |
| | 277 | * @param unknown_type $crop |
| | 278 | * @param unknown_type $suffix |
| | 279 | * @param unknown_type $dest_path |
| | 280 | * @param unknown_type $jpeg_quality |
| | 281 | * @return unknown |
| | 282 | */ |