Opened 14 years ago
Closed 14 years ago
#4705 closed defect (bug) (fixed)
bp_core_avatar_handle_crop() needs to save extensions correctly
| Reported by: | voldomazta | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.7 |
| Component: | Core | Version: | |
| Severity: | normal | Keywords: | |
| Cc: |
Description
this is how this function sets the thumb filenames:
$full_filename = wp_hash( $original_file . time() ) . '-bpfull.jpg';
$thumb_filename = wp_hash( $original_file . time() ) . '-bpthumb.jpg';
it should instead check whether the filename was a png or a gif using the getimagesize() php func so that it can choose a correct extension for the filename instead of just jpg all the time:
$data = @getimagesize($original_file);
$ext = $data['mime'] == 'image/png' ? 'png' : 'jpg';
// Set the full and thumb filenames
$full_filename = wp_hash( $original_file . time() ) . '-bpfull.' . $ext;
$thumb_filename = wp_hash( $original_file . time() ) . '-bpthumb.' . $ext;
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
(In [6600]) Avatars: