Skip to:

Opened 10 years ago

Closed 10 years ago

Last modified 8 years ago

#5417 closed defect (bug) (fixed)

Avatar upload error mesage

Reported by: stefwilliams's profile stefwilliams Owned by: boonebgorges's profile boonebgorges
Milestone: 2.0 Priority: low
Severity: normal Version: 1.9.2
Component: Media Keywords:


When an avatar image is uploaded to a profile or BP group, if the filename is too long (I think), the crop fails, with a generic message: "There was a problem cropping the avatar".
The image is still uploaded but the crop fails, saying the image is not found.
A more helpful error message would be good.
(As an example, the attached image fails as an avatar upload. Rename it to something shorter, and it should work.)

Attachments (1)

32203c6ae1bc3723a3432a38b1185490-bpthumb.jpg (2.6 KB) - added by stefwilliams 10 years ago.
failed avatar upload

Download all attachments as: .zip

Change History (5)

#1 @boonebgorges
10 years ago

  • Component changed from Core to Avatars
  • Milestone changed from Awaiting Review to 2.0
  • Priority changed from normal to low
  • Type changed from enhancement to defect (bug)

Thanks for the report. Actually, in your case, the file length is not the problem. The problem is the fact that you're uploading a file whose file is formatted like a BP avatar image file. When processing the crop, BuddyPress deletes all existing avatars before cropping and re-saving the new avatar. But because your new filename looked like an old avatar from BP's point of view, it was getting deleted too; as a result, there was nothing to crop, and BP threw an error.

It's an edge case to be sure, but we can work around it by ensuring that the existing file is not named the same as the uploaded file before deleting the existing one.

#2 @boonebgorges
10 years ago

  • Owner set to boonebgorges
  • Resolution set to fixed
  • Status changed from new to closed

In 7943:

Sanity check before deleting old avatar files before cropping new ones

Previously, if a user uploaded a new avatar file that had a name format like
an existing BP avatar file, BP would accidentally wipe that file out before
cropping. This would result in a failed crop, because the just-uploaded image
would be gone. This changeset introduces a sanity check: only delete existing
avatar files if the filename for those files is not the same as the uploaded

Fixes #5417

This ticket was mentioned in IRC in #buddypress-dev by svn-b896. View the logs.

10 years ago

#4 @DJPaul
8 years ago

  • Component changed from API - Avatars to Media
Note: See TracTickets for help on using tickets.