Skip to:
Content

BuddyPress.org

Opened 3 years ago

Closed 2 years ago

Last modified 2 years ago

#8643 closed enhancement (fixed)

Support .webp images for profile photos or cover images

Reported by: imath's profile imath Owned by: imath's profile imath
Milestone: 11.0.0 Priority: normal
Severity: normal Version:
Component: Media Keywords: needs-patch
Cc:

Description

This bad review contains a suggestion about supporting webp images. I believe we should include the support of it for profile photos and cover images.

Attachments (3)

8643.patch (5.8 KB) - added by imath 3 years ago.
8643.2.patch (6.0 KB) - added by imath 2 years ago.
8643.3.patch (9.5 KB) - added by imath 2 years ago.

Download all attachments as: .zip

Change History (13)

@imath
3 years ago

This ticket was mentioned in Slack in #buddypress by imath. View the logs.


3 years ago

#2 @imath
3 years ago

  • Keywords needs-refresh added; has-patch removed

NB: WordPress supports WebP since version 5.8, the patch needs to be updated to include a WP version check.

@imath
2 years ago

#3 @imath
2 years ago

  • Keywords has-patch added; needs-refresh removed

The above patch is adding some bp_is_running_wp( '5.8.0', '>=' ) to make sure BuddyPress profile image / cover image can use .webp images.

#4 @dcavins
2 years ago

This works well. I tried it with WP 5.7 and the current 6-alpha, and the behavior was as expected in both cases. I was sort of surprised when WP was able to edit a WebP. :)

I do sort of wish that instead of listing out the allowed types in bp_attachments_get_allowed_types(), we could fetch them from BP_Attachment->get_supported_image_types() so that they'd only be managed in one location.

Thanks for this update!

This ticket was mentioned in Slack in #buddypress by imath. View the logs.


2 years ago

@imath
2 years ago

#6 @imath
2 years ago

  • Keywords commit added

Thanks for you feedback @dcavins It helped me found some issues I've missed on the 2 first patches. Due to "historical filters" about the avatar object, it's easier to manage allowed file types from bp_attachments_get_allowed_types(), that's why I've removed BP_Attachment->get_supported_image_types() instead of your suggestion.

#7 @imath
2 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 13315:

Media: add support for the .webp image file type

NB: this support will only be available when the community site uses WP >= 5.8.

Props dcavins

Fixes #8643

#8 @imath
2 years ago

  • Keywords needs-patch added; has-patch commit removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

Ouch! I forgot to take in account the fact this support is only available in WP >= 5.8 in unit tests, that's why our it failed here: https://github.com/buddypress/buddypress/runs/7819196650

#9 @imath
2 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 13316:

Media: adjust avatar/cover image unit tests for the WP v5.7 context

As the .webp image file type will only be available if WP version >= 5.8, we need to only check for it using the same requirement.

Fixes #8643

This ticket was mentioned in Slack in #buddypress by imath. View the logs.


2 years ago

Note: See TracTickets for help on using tickets.