Ticket #6821: 6821.12.diff
File 6821.12.diff, 2.2 KB (added by , 11 years ago) |
---|
-
wp-includes/class-wp-image-editor-gd.php
51 51 if ( $this->image ) 52 52 return true; 53 53 54 if ( ! is_file( $this->file ) )54 if ( ! is_file( $this->file ) && ! preg_match( '|^https?://|', $this->file ) ) 55 55 return new WP_Error( 'error_loading_image', __('File doesn’t exist?'), $this->file ); 56 56 57 57 // Set artificially high because GD uses uncompressed images in memory -
wp-includes/class-wp-image-editor-imagick.php
52 52 if ( $this->image ) 53 53 return true; 54 54 55 if ( ! is_file( $this->file ) )55 if ( ! is_file( $this->file ) && ! preg_match( '|^https?://|', $this->file ) ) 56 56 return new WP_Error( 'error_loading_image', __('File doesn’t exist?'), $this->file ); 57 57 58 58 try { -
wp-admin/includes/image.php
22 22 * @param string $dst_file Optional. The destination file to write to. 23 23 * @return string|WP_Error|false New filepath on success, WP_Error or false on failure. 24 24 */ 25 function wp_crop_image( $src_file, $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h, $src_abs = false, $dst_file = false ) { 26 if ( is_numeric( $src_file ) ) { // Handle int as attachment ID 27 $src_file = get_attached_file( $src_file ); 25 function wp_crop_image( $src, $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h, $src_abs = false, $dst_file = false ) { 26 $src_file = $src; 27 if ( is_numeric( $src ) ) { // Handle int as attachment ID 28 $src_file = get_attached_file( $src ); 29 28 30 if ( ! file_exists( $src_file ) ) { 29 31 // If the file doesn't exist, attempt a url fopen on the src link. 30 32 // This can occur with certain file replication plugins. 31 $src_file = _load_image_to_edit_path( $src _file, 'full' );33 $src_file = _load_image_to_edit_path( $src, 'full' ); 32 34 } 33 35 } 34 36