X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/3f5685912e89eb3b0534acd85aa0946b1ca2bbe3..e9d988989fe37ab8c5f903e47fbe36e6e00dc51f:/wp-admin/includes/image-edit.php diff --git a/wp-admin/includes/image-edit.php b/wp-admin/includes/image-edit.php index b15575ae..03e7144a 100644 --- a/wp-admin/includes/image-edit.php +++ b/wp-admin/includes/image-edit.php @@ -39,12 +39,16 @@ function wp_image_editor($post_id, $msg = false) {
, this)" class="imgedit-crop disabled" title="">
- -
, this)" class="imgedit-rleft" title="">
-
, this)" class="imgedit-rright" title="">
+
, this)" title="">
+
, this)" title="">
+ +
+
+
, this)" class="imgedit-flipv" title="">
, this)" class="imgedit-fliph" title="">
@@ -92,10 +96,10 @@ function wp_image_editor($post_id, $msg = false) {
-

@@ -114,7 +118,7 @@ function wp_image_editor($post_id, $msg = false) {

- +
  • @@ -197,10 +201,11 @@ function load_image_to_edit($post_id, $mime_type, $size = 'full') { $filepath = get_attached_file($post_id); if ( $filepath && file_exists($filepath) ) { - if ( 'full' != $size && ( $data = image_get_intermediate_size($post_id, $size) ) ) - $filepath = path_join( dirname($filepath), $data['file'] ); + if ( 'full' != $size && ( $data = image_get_intermediate_size($post_id, $size) ) ) { + $filepath = apply_filters('load_image_to_edit_filesystempath', path_join( dirname($filepath), $data['file'] ), $post_id, $size); + } } elseif ( WP_Http_Fopen::test() ) { - $filepath = wp_get_attachment_url($post_id); + $filepath = apply_filters('load_image_to_edit_attachmenturl', wp_get_attachment_url($post_id) , $post_id, $size); } $filepath = apply_filters('load_image_to_edit_path', $filepath, $post_id, $size); @@ -417,7 +422,7 @@ function wp_restore_image($post_id) { $file = get_attached_file($post_id); $backup_sizes = get_post_meta( $post_id, '_wp_attachment_backup_sizes', true ); $restored = false; - $msg = ''; + $msg = new stdClass; if ( !is_array($backup_sizes) ) { $msg->error = __('Cannot load image metadata.'); @@ -449,7 +454,7 @@ function wp_restore_image($post_id) { $meta['file'] = _wp_relative_upload_path( $restored_file ); $meta['width'] = $data['width']; $meta['height'] = $data['height']; - list ( $uwidth, $uheight ) = wp_shrink_dimensions($meta['width'], $meta['height']); + list ( $uwidth, $uheight ) = wp_constrain_dimensions($meta['width'], $meta['height'], 128, 96); $meta['hwstring_small'] = "height='$uheight' width='$uwidth'"; } @@ -488,7 +493,7 @@ function wp_restore_image($post_id) { } function wp_save_image($post_id) { - $return = ''; + $return = new stdClass; $success = $delete = $scaled = $nocrop = false; $post = get_post($post_id); @ini_set('memory_limit', '256M'); @@ -594,7 +599,7 @@ function wp_save_image($post_id) { $meta['width'] = imagesx($img); $meta['height'] = imagesy($img); - list ( $uwidth, $uheight ) = wp_shrink_dimensions($meta['width'], $meta['height']); + list ( $uwidth, $uheight ) = wp_constrain_dimensions($meta['width'], $meta['height'], 128, 96); $meta['hwstring_small'] = "height='$uheight' width='$uwidth'"; if ( $success && ('nothumb' == $target || 'all' == $target) ) {