Skip to:
Content

BuddyPress.org

Ticket #4214: crop_images_err.patch

File crop_images_err.patch, 883 bytes (added by magnus78, 12 years ago)

proposed fix

  • bp-core/bp-core-avatars.php

     
    546546
    547547        // Crop the image
    548548        $full_cropped  = wp_crop_image( $original_file, (int)$crop_x, (int)$crop_y, (int)$crop_w, (int)$crop_h, bp_core_avatar_full_width(), bp_core_avatar_full_height(), false, $avatar_folder_dir . '/' . $full_filename );
     549        if ( is_wp_error($full_cropped) || !$full_cropped )
     550                return false;
    549551        $thumb_cropped = wp_crop_image( $original_file, (int)$crop_x, (int)$crop_y, (int)$crop_w, (int)$crop_h, bp_core_avatar_thumb_width(), bp_core_avatar_thumb_height(), false, $avatar_folder_dir . '/' . $thumb_filename );
     552        if ( is_wp_error($thumb_cropped) || !$thumb_cropped )
     553                return false;
    550554
    551555        // Remove the original
    552556        @unlink( $original_file );