Ticket #1294 (closed defect: fixed)

Opened 10 months ago

Last modified 7 months ago

Group Avatar Crop Tool failure

Reported by: gazouteast Owned by: jason_jm
Priority: minor Milestone: 1.2
Component: Keywords: Group creation, Group edit, avatars, needs-patch
Cc: jason_jm

Description

With a clean install of BP 1.1.2 onto WP 2.8.4a using all default themes etc
PHP & MySQL 5.x on CentOS 5.x shared hosting

Creating a group in BuddyPress consistently demonstrates the following -

At very first (i.e. one time only) group creation, the avatar page offers the back button and skip button - they never ever appear again during any group creation or editing any group via admin -> avatars. Checking page source, and using FireBug? on FireFox, the code for those buttons is not present in the page.

But the main issue is that the javascript avatar cropper fails to load the image, trashes it to a 0Kb file, and hangs the active content of the page.

What is displayed is an 88x16 black oblong with no portion of the avatar image, the cropper handle will allow enlarge only to the 16px height of the black background, but attempting save causes a failure with "image failed to save" error.

clicking off the frame to My Groups in the second column shows the group as created without avatar, without invites, and basically, non-functional - it cannot be used for anything ... although it can be deleted and another creation attempt made, but the avatar page has neither the back or skip buttons, even when using a different group name.

Deleting the group via MySql?, and the avatars (+ group folders) using cPanel file manager / FTP then allows creation of a new group ID 1, but again the back and skip buttons do not show on the avatar page, although this time the generated gravatar will display but cannot save as there is also no way to move to the next screen (invites).

Lots of BP forum threads kicking up on this one, and none of them contain a solution that has worked for me.

The number of complaints about this, and some of the esotericness of the fixes, clearly label this one as buggy code.

Change History

Changed 10 months ago by johnjamesjacoby

Any updates on this? It appears to be an isolated issue.

Changed 10 months ago by jason_jm

  • cc jason_jm added
  • owner set to jason_jm
  • status changed from new to assigned
  • summary changed from BP 1.1.2 on WPMU 2.8.4a Group Avatar Crop Tool failure to Group Avatar Crop Tool failure

While I look at this can you tell me what browsers and versions this worked on just for reference while I take a look?

Changed 10 months ago by jason_jm

I can not verify your issue: "But the main issue is that the javascript avatar cropper fails to load the image, trashes it to a 0Kb file, and hangs the active content of the page."

I created a test group @:
 http://testbp.org/groups/ticket1294

Using Chrome/Safari/Webkit? things are working so far.

Questions
* What was the image dimensions of the image you tried using?
* What browser(s) are you using?

Changed 10 months ago by jason_jm

  • priority changed from critical to minor

Flagging minor at the moment

I cannot verify and is working for me.

Awaiting additional info.

Changed 9 months ago by apeatling

This is most likely down to file system permissions and the cropper not gracefully failing under certain circumstances. For the most part the cropper works with no problem for people.

Changed 8 months ago by nuprn1

On a fresh trunk install with single WP

I noticed this problem where the step after image-upload (for croppping) was not appearing. After some digging around I noticed on bp-core-avatars.php

260 if ( getimagesize( $bp->avatar_admin->originalfile? ) > BP_AVATAR_ORIGINAL_MAX_WIDTH ) {
261 $bp->avatar_admin->resized = wp_create_thumbnail( $bp->avatar_admin->originalfile?, BP_AVATAR_ORIGINAL_MAX_WIDTH );
262 }

the getimagesize was not returning a value, and the filepath was not full

$bp->avatar_admin->originalfile? = str_replace('wp-content',,$bp->avatar_admin->originalfile?);
$bp->avatar_admin->originalfile? = WP_CONTENT_DIR . $bp->avatar_admin->originalfile?;

// Resize the image down to something manageable and then delete the original
list($width, $height) = getimagesize( $bp->avatar_admin->originalfile? );

if ( $width > BP_AVATAR_ORIGINAL_MAX_WIDTH ) {

$bp->avatar_admin->resized = wp_create_thumbnail( $bp->avatar_admin->originalfile?, BP_AVATAR_ORIGINAL_MAX_WIDTH );

}

I'm able to crop but gif/png transparency is being converted to black background

Changed 8 months ago by nuprn1

... and now i see why the returning gif/png is black.

wp_crop_image returns a jpg

$dst_file = preg_replace( '/\\.[\\.]+$/', '.jpg', $dst_file );
if ( imagejpeg( $dst, $dst_file, apply_filters( 'jpeg_quality', 90, 'wp_crop_image' ) ) )
return $dst_file;

Changed 8 months ago by apeatling

  • keywords avatars, needs-patch added; avatars removed

Changed 7 months ago by apeatling

@nuprn1 - can you submit a patch?

Changed 7 months ago by erich73

Changed 7 months ago by apeatling

  • status changed from assigned to closed
  • resolution set to fixed

I've never been able to reproduce this. There have been tweaks to avatar cropping since this was opened. I'm marking this as fixed, please reopen if you can reproduce, along with steps to reproduce.

Note: See TracTickets for help on using tickets.