| 200 | | // same as wp_shrink_dimensions, except the max parameters are optional. |
| 201 | | // if either width or height are empty, no constraint is applied on that dimension. |
| | 213 | /** |
| | 214 | * Calculates the new dimentions for a downsampled image. |
| | 215 | * |
| | 216 | * Same as {@link wp_shrink_dimensions()}, except the max parameters are |
| | 217 | * optional. If either width or height are empty, no constraint is applied on |
| | 218 | * that dimension. |
| | 219 | * |
| | 220 | * @since 2.5.0 |
| | 221 | * |
| | 222 | * @param int $current_width Current width of the image. |
| | 223 | * @param int $current_height Current height of the image. |
| | 224 | * @param int $max_width Optional. Maximum wanted width. |
| | 225 | * @param int $max_height Optional. Maximum wanted height. |
| | 226 | * @return array First item is the width, the second item is the height. |
| | 227 | */ |
| 220 | | // calculate dimensions and coordinates for a resized image that fits within a specified width and height |
| 221 | | // if $crop is true, the largest matching central portion of the image will be cropped out and resized to the required size |
| | 246 | /** |
| | 247 | * Retrieve calculated resized dimensions for use in imagecopyresampled(). |
| | 248 | * |
| | 249 | * Calculate dimensions and coordinates for a resized image that fits within a |
| | 250 | * specified width and height. If $crop is true, the largest matching central |
| | 251 | * portion of the image will be cropped out and resized to the required size. |
| | 252 | * |
| | 253 | * @since 2.5.0 |
| | 254 | * |
| | 255 | * @param int $orig_w Original width. |
| | 256 | * @param int $orig_h Original height. |
| | 257 | * @param int $dest_w New width. |
| | 258 | * @param int $dest_h New height. |
| | 259 | * @param bool $crop Optional, default is false. Whether to crop image or resize. |
| | 260 | * @return bool|array False, on failure. Returned array matches parameters for imagecopyresampled() PHP function. |
| | 261 | */ |
| 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 |
| | 314 | * {@internal Missing Long Description}} |
| | 315 | * |
| | 316 | * @since 2.5.0 |
| | 317 | * |
| | 318 | * @param string $file Image file path. |
| | 319 | * @param int $max_w Maximum width to resize to. |
| | 320 | * @param int $max_h Maximum height to resize to. |
| | 321 | * @param bool $crop Optional. Whether to crop image or resize. |
| | 322 | * @param string $suffix Optional. File Suffix. |
| | 323 | * @param string $dest_path Optional. New image file path. |
| | 324 | * @param int $jpeg_quality Optional, default is 90. Image quality percentage. |
| | 325 | * @return mixed WP_Error on failure. String with new destination path. Array of dimensions from {@link image_resize_dimensions()} |
| 345 | | // resize an image to make a thumbnail or intermediate size, and return metadata describing the new copy |
| 346 | | // returns false if no image was created |
| | 389 | /** |
| | 390 | * Resize an image to make a thumbnail or intermediate size. |
| | 391 | * |
| | 392 | * The returned array has the file size, the image width, and image height. The |
| | 393 | * filter 'image_make_intermediate_size' can be used to hook in and change the |
| | 394 | * values of the returned array. The only parameter is the resized file path. |
| | 395 | * |
| | 396 | * @since 2.5.0 |
| | 397 | * |
| | 398 | * @param string $file File path. |
| | 399 | * @param int $width Image width. |
| | 400 | * @param int $height Image height. |
| | 401 | * @param bool $crop Optional, default is false. Whether to crop image to specified height and width or resize. |
| | 402 | * @return bool|array False, if no image was created. Metadata array on success. |
| | 403 | */ |
| | 419 | /** |
| | 420 | * {@internal Missing Short Description}} |
| | 421 | * |
| | 422 | * The $size parameter can be an array with the width and height respectively. |
| | 423 | * If the size matches the 'sizes' metadata array for width and height, then it |
| | 424 | * will be used. If there is no direct match, then the nearest image size larger |
| | 425 | * than the specified size will be used. If nothing is found, then the function |
| | 426 | * will break out and return false. |
| | 427 | * |
| | 428 | * The metadata 'sizes' is used for compatible sizes that can be used for the |
| | 429 | * parameter $size value. |
| | 430 | * |
| | 431 | * The url path will be given, when the $size parameter is a string. |
| | 432 | * |
| | 433 | * @since 2.5.0 |
| | 434 | * |
| | 435 | * @param int $post_id Attachment ID for image. |
| | 436 | * @param array|string $size Optional, default is 'thumbnail'. Size of image, either array or string. |
| | 437 | * @return bool|array False on failure or array of file path, width, and height on success. |
| | 438 | */ |
| 405 | | // get an image to represent an attachment - a mime icon for files, thumbnail or intermediate size for images |
| 406 | | // returns an array (url, width, height), or false if no image is available |
| | 482 | /** |
| | 483 | * Retrieve an image to represent an attachment. |
| | 484 | * |
| | 485 | * A mime icon for files, thumbnail or intermediate size for images. |
| | 486 | * |
| | 487 | * @since 2.5.0 |
| | 488 | * |
| | 489 | * @param int $attachment_id Image attachment ID. |
| | 490 | * @param string $size Optional, default is 'thumbnail'. |
| | 491 | * @param bool $icon Optional, default is false. Whether it is an icon. |
| | 492 | * @return bool|array Returns an array (url, width, height), or false, if no image is available. |
| | 493 | */ |
| 423 | | // as per wp_get_attachment_image_src, but returns an <img> tag |
| | 510 | /** |
| | 511 | * {@internal Missing Short Description}} |
| | 512 | * |
| | 513 | * As per wp_get_attachment_image_src, but returns an <img> tag. |
| | 514 | * {@internal Missing Long Description}} |
| | 515 | * |
| | 516 | * @since 2.5.0 |
| | 517 | * |
| | 518 | * @param int $attachment_id Image attachment ID. |
| | 519 | * @param string $size Optional, default is 'thumbnail'. |
| | 520 | * @param bool $icon Optional, default is false. Whether it is an icon. |
| | 521 | * @return string HTML img element or empty string on failure. |
| | 522 | */ |