BuddyDev

Search

[Resolved] Cover Image cropping feature (like the avatar cropping feature)

Tagged: 

  • Participant
    Level: Enlightened
    Posts: 56
    Andy on #1765

    And yes, adding multiple versions of the header image to avoid wastage bandwidth also sounds a great idea.

    • This reply was modified 8 years, 4 months ago by Andy.
    • This reply was modified 8 years, 4 months ago by Andy.
    • This reply was modified 8 years, 4 months ago by Andy.
  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #1769

    Hi Andy,
    Thank you for sharing.
    Your image responds beacutifully. I had used some other way ( two containers, inner for content+overlay and outer for the background image). I did set background-size:cover and position to center, center. That saves a lot. My implementation is working but is not the best thing(specially on small screens).

    I like your concept of using proper ratio and cropping. Thank you for all the explanations.

    Here is the code for the modfied function

    http://pastebin.com/DNYqJpjZ

    It is almost same of the core handler with 2 small changes. I did not like copying the whole function and I have dropped the idea of multiple cover image for now, It needs more work in BuddyPress core. I will be opening a ticket, If things get in the right direction, the above task could be accomplished in 4-5 lines without any duplication of code.

    For now, Please use the above code. Please do let me know if that works for you or not?

  • Participant
    Level: Enlightened
    Posts: 56
    Andy on #1771

    Hi Brajesh

    This worked. Thank you.

    Yes, I’ve read a similar issue with image cropping on the BuddyPress forums, and the code you provided I think would solve others cover image issues too, so I think it will be beneficial for BuddyPress to add those 3 or 4 lines of code to their core.

    I’ve got everything perfect now though, thanks for your help 🙂

    • This reply was modified 8 years, 4 months ago by Andy.
  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #1778

    Thank you Andy 🙂
    I am certainly opening a ticket in a day or two.

    I am glad everything is working for you. All the best with your project 🙂

    Please do let me know if you need any help in future.

    Thank you
    Brajesh

The topic ‘ [Resolved] Cover Image cropping feature (like the avatar cropping feature)’ is closed to new replies.

This topic is: resolved