Make WordPress Core

Ticket #31353: 31353.diff

File 31353.diff, 3.2 KB (added by DrewAPicture, 10 years ago)
  • src/wp-admin/includes/image-edit.php

     
    77 */
    88
    99/**
    10  * @param int $post_id
    11  * @param bool|object $msg
     10 * Loads the WP image-editing interface.
     11 *
     12 * @param int         $post_id Post ID.
     13 * @param bool|object $msg     Optional. Message to display for image editor updates or errors.
     14 *                             Default false.
    1215 */
    1316function wp_image_editor($post_id, $msg = false) {
    1417        $nonce = wp_create_nonce("image_editor-$post_id");
     
    330333        }
    331334}
    332335
     336/**
     337 * Image preview ratio. Internal use only.
     338 *
     339 * @since 2.9.0
     340 *
     341 * @ignore
     342 * @param int $w Image width in pixels.
     343 * @param int $h Image height in pixels.
     344 * @return float|int Image preview ratio.
     345 */
    333346function _image_get_preview_ratio($w, $h) {
    334347        $max = max($w, $h);
    335348        return $max > 400 ? (400 / $max) : 1;
    336349}
    337350
    338 // @TODO: Returns GD resource, but is NOT public
     351/**
     352 * Returns an image resource. Internal use only.
     353 *
     354 * @since 2.9.0
     355 *
     356 * @ignore
     357 * @param resource  $img   Image resource.
     358 * @param float|int $angle Image rotation angle, in degrees.
     359 * @return resource|false GD image resource, false otherwise.
     360 */
    339361function _rotate_image_resource($img, $angle) {
    340362        _deprecated_function( __FUNCTION__, '3.5', __( 'Use WP_Image_Editor::rotate' ) );
    341363        if ( function_exists('imagerotate') ) {
     
    349371}
    350372
    351373/**
    352  * @TODO: Only used within image_edit_apply_changes
    353  *                and receives/returns GD Resource.
    354  *                Consider removal.
     374 * Flips an image resource. Internal use only.
    355375 *
    356  * @param GD_Resource $img
    357  * @param boolean $horz
    358  * @param boolean $vert
    359  * @return GD_Resource
     376 * @since 2.9.0
     377 *
     378 * @ignore
     379 * @param resource $img  Image resource.
     380 * @param bool     $horz Whether to flip horizontally.
     381 * @param bool     $vert Whether to flip vertically.
     382 * @return resource (maybe) flipped image resource.
    360383 */
    361384function _flip_image_resource($img, $horz, $vert) {
    362385        _deprecated_function( __FUNCTION__, '3.5', __( 'Use WP_Image_Editor::flip' ) );
     
    378401}
    379402
    380403/**
    381  * @TODO: Only used within image_edit_apply_changes
    382  *                and receives/returns GD Resource.
    383  *                Consider removal.
     404 * Crops an image resource. Internal use only.
    384405 *
    385  * @param GD_Resource $img
    386  * @param float $x
    387  * @param float $y
    388  * @param float $w
    389  * @param float $h
    390  * @return GD_Resource
     406 * @since 2.9.0
     407 *
     408 * @ignore
     409 * @param resource $img Image resource.
     410 * @param float    $x   Source point x-coordinate.
     411 * @param float    $y   Source point y-cooredinate.
     412 * @param float    $w   Source width.
     413 * @param float    $h   Source height.
     414 * @return resource (maybe) cropped image resource.
    391415 */
    392416function _crop_image_resource($img, $x, $y, $w, $h) {
    393417        $dst = wp_imagecreatetruecolor($w, $h);
     
    561585}
    562586
    563587/**
    564  * @param int $post_id
    565  * @return stdClass
     588 * Restores an image.
     589 *
     590 * @since 2.9.0
     591 *
     592 * @param int $post_id Post ID.
     593 * @return stdClass Image restoration message object.
    566594 */
    567595function wp_restore_image($post_id) {
    568596        $meta = wp_get_attachment_metadata($post_id);