Skip to:
Content
Pages
Categories
Search
Top
Bottom

Keep fullsize picture while uploading avatar


  • sx1001
    Participant

    @sx1001

    Hi guys,

    I want to keep the fullsize version of the picture being uploaded when updating the avatar and show it when clicking on the avatar in the user profile. The second part, clicking and displaying it in the lightbox is not a big deal.

    The big deal is to keep the original picture, as well as applying the same relative crop like the user does when cropping himself, because the crop is applied in the frontend on the already down-sampled avatar.

    Is there any easy solution for that?
    I found already that there are only very few hooks to hook into.
    the whole upload seems to take place in one big function bp_core_avatar_handle_upload() which also deletes the original file (see the unlink command). There is only one filter, “bp_core_pre_avatar_handle_upload” with which I can overwrite the whole function.

    That’s what I mean, it doesnt seem easy. It seems I have to fully copy the function and hook it using that filter. Any other option?

    The same applies for the second step, the cropping part, there’s only one filter as well, “bp_core_pre_avatar_handle_crop”, to overwrite the whole cropping function.

    So, overall, quite complicated.
    Anyone ever came up with some solution here?

    Thanks

  • You must be logged in to reply to this topic.
Skip to toolbar