BuddyDev

Search

[Resolved] Question about gallery image size

  • Participant
    Level: Initiated
    Posts: 5
    Tyler Claypool on #4239

    I have a question about the size of the images that are displayed in the gallery. Are they able to be changed as far as the size goes? I have a picture to help explain and show the area I’m talking about but I can’t post it here it seems.

    Basically it’s for images not opening in the lightbox.

    So it’s for images found under the user profile -> your galleries -> gallery name -> then the image.

    It’s saying the image is cropped down to 720px by 541px. Is this something that gets coded in from MediaPress or is it a BuddyPress thing? I can’t seem to find where the code is that sets that resolution. The image gets uploaded and no matter what size it is, it gets changed down to the dimensions listed up above.

  • Keymaster
    (BuddyDev Team)
    Posts: 24332
    Brajesh Singh on #4251

    Hi Tyler,
    In MediaPress, we have restricted the larger image size to 800×600 and that seems to be doing it.

    It is this code snippet doing it in mpp-init.php

    
        mpp_register_media_size( array(
                'name'  => 'large',
                'height'=> 800,
                'width' => 600,
                'crop'  => false,
                'type'  => 'default'
        ) );
    
    

    We can override it by putting this in our bp-custom.php

    
    
    function mpp_custom_setup_custom_image_size() {
    	
    	    mpp_register_media_size( array(
                'name'   => 'large',
                'height' => 1000, //change it
                'width'  => 1000,
                'crop'   => false,
                'type'   => 'default'// can be photo/video/audio/doc, default applies to all media type
        ) );
    		
    		
    }
    add_action( 'mpp_setup_core', 'mpp_custom_setup_custom_image_size' );
    
    

    Hope that helps.
    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 5
    Tyler Claypool on #4316

    This worked like a charm, thank you!

  • Keymaster
    (BuddyDev Team)
    Posts: 24332
    Brajesh Singh on #4321

    Thank you 🙂

The topic ‘ [Resolved] Question about gallery image size’ is closed to new replies.

This topic is: resolved